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
Returns a new instance of Comma.
2929 2930 2931 2932 |
# File 'lib/syntax_tree/node.rb', line 2929 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#value ⇒ Object (readonly)
- String
-
the comma in the string
2927 2928 2929 |
# File 'lib/syntax_tree/node.rb', line 2927 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
2934 2935 2936 |
# File 'lib/syntax_tree/node.rb', line 2934 def accept(visitor) visitor.visit_comma(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
2938 2939 2940 |
# File 'lib/syntax_tree/node.rb', line 2938 def child_nodes [] end |
#deconstruct_keys(_keys) ⇒ Object
2944 2945 2946 |
# File 'lib/syntax_tree/node.rb', line 2944 def deconstruct_keys(_keys) { value: value, location: location } end |