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
#construct_keys, #format, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:) ⇒ Comma
3016 3017 3018 3019 |
# File 'lib/syntax_tree/node.rb', line 3016 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#value ⇒ Object (readonly)
- String
-
the comma in the string
3014 3015 3016 |
# File 'lib/syntax_tree/node.rb', line 3014 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
3021 3022 3023 |
# File 'lib/syntax_tree/node.rb', line 3021 def accept(visitor) visitor.visit_comma(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
3025 3026 3027 |
# File 'lib/syntax_tree/node.rb', line 3025 def child_nodes [] end |
#deconstruct_keys(_keys) ⇒ Object
3031 3032 3033 |
# File 'lib/syntax_tree/node.rb', line 3031 def deconstruct_keys(_keys) { value: value, location: location } end |