Class: SyntaxTree::Comma
Overview
Comma represents the use of the , operator.
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
- String
-
the comma in the string.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(value:, location:) ⇒ Comma
constructor
A new instance of Comma.
Methods inherited from Node
#format, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:) ⇒ Comma
Returns a new instance of Comma.
2481 2482 2483 2484 |
# File 'lib/syntax_tree/node.rb', line 2481 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#value ⇒ Object (readonly)
- String
-
the comma in the string
2479 2480 2481 |
# File 'lib/syntax_tree/node.rb', line 2479 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
2486 2487 2488 |
# File 'lib/syntax_tree/node.rb', line 2486 def accept(visitor) visitor.visit_comma(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
2490 2491 2492 |
# File 'lib/syntax_tree/node.rb', line 2490 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
2496 2497 2498 |
# File 'lib/syntax_tree/node.rb', line 2496 def deconstruct_keys(keys) { value: value, location: location } end |