Class: LibRubyParser::Nodes::Defs
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::Defs
- Defined in:
- lib/lib-ruby-parser/nodes.rb
Overview
Represents a singleton method definition (i.e. ‘def self.foo; end`)
Instance Attribute Summary collapse
-
#args ⇒ Node?
readonly
Arguments of a method,
Noneif there’s no arguments. -
#assignment_l ⇒ Loc?
readonly
Location of the ‘=` operator for endless method definition.
-
#body ⇒ Node?
readonly
Body of the method,
Noneif there’s no body. -
#definee ⇒ Node
readonly
Definee of a method definition, ‘Lvar(“x”)` for `def x.foo; end`.
-
#end_l ⇒ Loc?
readonly
Location of the
endkeyword. -
#expression_l ⇒ Loc
readonly
Location of the full expression.
-
#keyword_l ⇒ Loc
readonly
Location of the
defkeyword. -
#name ⇒ String
readonly
Name of the method, ‘String(“foo”)` for `def x.foo; end`.
-
#name_l ⇒ Loc
readonly
Location of the method name.
-
#operator_l ⇒ Loc
readonly
Location of the
..
Instance Attribute Details
#args ⇒ Node? (readonly)
Arguments of a method, None if there’s no arguments.
All information about parentheses around arguments is stored in this node.
1130 1131 1132 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1130 def args @args end |
#assignment_l ⇒ Loc? (readonly)
Location of the ‘=` operator for endless method definition
“‘text def self.foo() = 42
~
“‘
None for regular method definition
1172 1173 1174 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1172 def assignment_l @assignment_l end |
#body ⇒ Node? (readonly)
Body of the method, None if there’s no body.
1134 1135 1136 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1134 def body @body end |
#definee ⇒ Node (readonly)
Definee of a method definition, ‘Lvar(“x”)` for `def x.foo; end`
1120 1121 1122 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1120 def definee @definee end |
#end_l ⇒ Loc? (readonly)
Location of the end keyword
“‘text def self.foo; end
~~~
“‘
None for endless method definition
1183 1184 1185 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1183 def end_l @end_l end |
#expression_l ⇒ Loc (readonly)
Location of the full expression
“‘text def self.foo; end ~~~~~~~~~~~~~~~~~ “`
1192 1193 1194 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1192 def expression_l @expression_l end |
#keyword_l ⇒ Loc (readonly)
Location of the def keyword
“‘text def self.foo; end ~~~ “`
1143 1144 1145 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1143 def keyword_l @keyword_l end |
#name ⇒ String (readonly)
Name of the method, ‘String(“foo”)` for `def x.foo; end`
1124 1125 1126 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1124 def name @name end |
#name_l ⇒ Loc (readonly)
Location of the method name
“‘text def self.foo; end
~~~
“‘
1161 1162 1163 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1161 def name_l @name_l end |
#operator_l ⇒ Loc (readonly)
Location of the .
“‘text def self.foo; end
~
“‘
1152 1153 1154 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1152 def operator_l @operator_l end |