File tree Expand file tree Collapse file tree 2 files changed +84
-0
lines changed Expand file tree Collapse file tree 2 files changed +84
-0
lines changed Original file line number Diff line number Diff line change @@ -34,49 +34,91 @@ The usual way to obtain an object of type C<Attribute> is by introspection:
34
34
35
35
= head2 method name
36
36
37
+ Defined as:
38
+
37
39
method name(Attribute:D:) returns Str:D
38
40
41
+ Usage:
42
+
43
+ ATTRIBUTE.name
44
+
39
45
Returns the name of the attribute. Note that this is always the private name,
40
46
so if an attribute is declared as C < has $.a > , the name returned is C < $!a > .
41
47
42
48
= head2 method package
43
49
50
+ Defined as:
51
+
44
52
method package(Attribute:D:) returns Mu:U
45
53
54
+ Usage:
55
+
56
+ ATTRIBUTE.package
57
+
46
58
Returns the package (class/grammar/role) to which this attribute belongs.
47
59
48
60
= head2 method has-accessor
49
61
62
+ Defined as:
63
+
50
64
method has-accessor(Attribute:D:) returns Bool:D
51
65
66
+ Usage:
67
+
68
+ ATTRIBUTE.has-accessor
69
+
52
70
Returns C < True > if the attribute has a public accessor method.
53
71
54
72
= head2 method readonly
55
73
74
+ Defined as:
75
+
56
76
method readonly(Attribute:D:) returns Bool:D
57
77
78
+ Usage:
79
+
80
+ ATTRIBUTE.readonly
81
+
58
82
Returns C < True > for readonly attributes, which is the default.
59
83
Returns C < False > for attributes marked as C < is rw > .
60
84
61
85
= head2 method type
62
86
87
+ Defined as:
88
+
63
89
method type(Attribute:D:) returns Mu
64
90
91
+ Usage:
92
+
93
+ ATTRIBUTE.type
94
+
65
95
Returns the type constraint of the attribute.
66
96
67
97
= head2 method get_value
68
98
99
+ Defined as:
100
+
69
101
method get_value(Attribute:D: Mu $instance)
70
102
103
+ Usage:
104
+
105
+ ATTRIBUTE.get_value
106
+
71
107
Returns the value stored in this attribute of object C < $instance > .
72
108
73
109
Note that this method violates encapsulation of the object, and should be
74
110
used with care. Here be dragons.
75
111
76
112
= head2 method set_value
77
113
114
+ Defined as:
115
+
78
116
method set_value(Attribute:D: Mu $instance, Mu \new_val)
79
117
118
+ Usage:
119
+
120
+ ATTRIBUTE.set_value
121
+
80
122
Binds the value C < new_val > to this attribute of object C < $instance > .
81
123
82
124
Note that this method violates encapsulation of the object, and should be
Original file line number Diff line number Diff line change @@ -12,46 +12,88 @@ A single backtrace frame. It identifies a location in the source code.
12
12
13
13
= head2 method file
14
14
15
+ Defined as:
16
+
15
17
method file(Backtrace::Frame:D) returns Str
16
18
19
+ Usage:
20
+
21
+ FRAME.file
22
+
17
23
Returns the file name.
18
24
19
25
= head2 method line
20
26
27
+ Defined as:
28
+
21
29
method line(Backtrace::Frame:D) returns Int
22
30
31
+ Usage:
32
+
33
+ FRAME.line
34
+
23
35
Returns the line number (line numbers start to count from 1).
24
36
25
37
= head2 method code
26
38
39
+ Defined as:
40
+
27
41
method code(Backtrace::Frame:D)
28
42
43
+ Usage:
44
+
45
+ FRAME.code
46
+
29
47
Returns the code object into which C < .file > and C < .line > point, if available.
30
48
31
49
= head2 method subname
32
50
51
+ Defined as:
52
+
33
53
method subname(Backtrace::Frame:D) returns Str
34
54
55
+ Usage:
56
+
57
+ FRAME.subname
58
+
35
59
Returns the name of the enclosing subroutine.
36
60
37
61
= head2 method is-hidden
38
62
63
+ Defined as:
64
+
39
65
method is-hidden(Backtrace::Frame:D) return Bool:D
40
66
67
+ Usage:
68
+
69
+ FRAME.is-hidden
70
+
41
71
Returns C < True > if the frame is marked as hidden with the
42
72
C < is hidden-from-backtrace > trait.
43
73
44
74
= head2 method is-routine
45
75
76
+ Defined as:
77
+
46
78
method is-routine(Backtrace::Frame:D) return Bool:D
47
79
80
+ Usage:
81
+
82
+ FRAME.is-routine
83
+
48
84
Return C < True > if the frame point into a routine (and not
49
85
into a mere L < Block > ).
50
86
51
87
= head2 method is-setting
52
88
89
+ Defined as:
90
+
53
91
method is-setting(Backtrace::Frame:D) return Bool:D
54
92
93
+ Usage:
94
+
95
+ FRAME.is-setting
96
+
55
97
Returns C < True > if the frame is part of a setting.
56
98
57
99
= end pod
You can’t perform that action at this time.
0 commit comments