Class: SyntaxTree::SymbolsBeg
Overview
SymbolsBeg represents the start of a symbol array literal with interpolation.
%I[one two three]
In the snippet above, SymbolsBeg represents the “%I[” token. Note that these kinds of arrays can start with a lot of different delimiter types (e.g., %I| or %I<).
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
- String
-
the beginning of the symbol literal array.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(_keys) ⇒ Object
-
#initialize(value:, location:) ⇒ SymbolsBeg
constructor
A new instance of SymbolsBeg.
Methods inherited from Node
#construct_keys, #format, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:) ⇒ SymbolsBeg
Returns a new instance of SymbolsBeg.
8711 8712 8713 8714 |
# File 'lib/syntax_tree/node.rb', line 8711 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#value ⇒ Object (readonly)
- String
-
the beginning of the symbol literal array
8709 8710 8711 |
# File 'lib/syntax_tree/node.rb', line 8709 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
8716 8717 8718 |
# File 'lib/syntax_tree/node.rb', line 8716 def accept(visitor) visitor.visit_symbols_beg(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
8720 8721 8722 |
# File 'lib/syntax_tree/node.rb', line 8720 def child_nodes [] end |
#deconstruct_keys(_keys) ⇒ Object
8726 8727 8728 |
# File 'lib/syntax_tree/node.rb', line 8726 def deconstruct_keys(_keys) { value: value, location: location } end |