Class: SyntaxTree::LabelEnd
Overview
LabelEnd represents the end of a dynamic symbol.
{ "key": value }
In the example above, LabelEnd represents the “":” token at the end of the hash key. This node is important for determining the type of quote being used by the label.
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
- String
-
the end of the label.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(value:, location:) ⇒ LabelEnd
constructor
A new instance of LabelEnd.
Methods inherited from Node
#format, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:) ⇒ LabelEnd
Returns a new instance of LabelEnd.
5248 5249 5250 5251 |
# File 'lib/syntax_tree/node.rb', line 5248 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#value ⇒ Object (readonly)
- String
-
the end of the label
5246 5247 5248 |
# File 'lib/syntax_tree/node.rb', line 5246 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
5253 5254 5255 |
# File 'lib/syntax_tree/node.rb', line 5253 def accept(visitor) visitor.visit_label_end(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
5257 5258 5259 |
# File 'lib/syntax_tree/node.rb', line 5257 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
5263 5264 5265 |
# File 'lib/syntax_tree/node.rb', line 5263 def deconstruct_keys(keys) { value: value, location: location } end |