Class: SyntaxTree::VCall
Overview
VCall represent any plain named object with Ruby that could be either a local variable or a method call.
variable
Instance Attribute Summary collapse
-
#comments ⇒ Object
readonly
- Array[ Comment | EmbDoc ]
-
the comments attached to this node.
-
#value ⇒ Object
readonly
- Ident
-
the value of this expression.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
- #format(q) ⇒ Object
-
#initialize(value:, location:, comments: []) ⇒ VCall
constructor
A new instance of VCall.
Methods inherited from Node
Constructor Details
#initialize(value:, location:, comments: []) ⇒ VCall
Returns a new instance of VCall.
9342 9343 9344 9345 9346 |
# File 'lib/syntax_tree/node.rb', line 9342 def initialize(value:, location:, comments: []) @value = value @location = location @comments = comments end |
Instance Attribute Details
#comments ⇒ Object (readonly)
- Array[ Comment | EmbDoc ]
-
the comments attached to this node
9340 9341 9342 |
# File 'lib/syntax_tree/node.rb', line 9340 def comments @comments end |
#value ⇒ Object (readonly)
- Ident
-
the value of this expression
9337 9338 9339 |
# File 'lib/syntax_tree/node.rb', line 9337 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
9348 9349 9350 |
# File 'lib/syntax_tree/node.rb', line 9348 def accept(visitor) visitor.visit_vcall(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
9352 9353 9354 |
# File 'lib/syntax_tree/node.rb', line 9352 def child_nodes [value] end |
#deconstruct_keys(keys) ⇒ Object
9358 9359 9360 |
# File 'lib/syntax_tree/node.rb', line 9358 def deconstruct_keys(keys) { value: value, location: location, comments: comments } end |
#format(q) ⇒ Object
9362 9363 9364 |
# File 'lib/syntax_tree/node.rb', line 9362 def format(q) q.format(value) end |