Class: SyntaxTree::QSymbolsBeg
Overview
QSymbolsBeg represents the beginning of a symbol literal array.
%i[one two three]
In the snippet above, QSymbolsBeg 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 array literal.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(value:, location:) ⇒ QSymbolsBeg
constructor
A new instance of QSymbolsBeg.
- #pretty_print(q) ⇒ Object
Methods inherited from Node
Constructor Details
#initialize(value:, location:) ⇒ QSymbolsBeg
Returns a new instance of QSymbolsBeg.
6907 6908 6909 6910 |
# File 'lib/syntax_tree/node.rb', line 6907 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#value ⇒ Object (readonly)
- String
-
the beginning of the array literal
6905 6906 6907 |
# File 'lib/syntax_tree/node.rb', line 6905 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
6912 6913 6914 |
# File 'lib/syntax_tree/node.rb', line 6912 def accept(visitor) visitor.visit_qsymbols_beg(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
6916 6917 6918 |
# File 'lib/syntax_tree/node.rb', line 6916 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
6922 6923 6924 |
# File 'lib/syntax_tree/node.rb', line 6922 def deconstruct_keys(keys) { value: value, location: location } end |
#pretty_print(q) ⇒ Object
6926 6927 6928 6929 6930 6931 6932 6933 |
# File 'lib/syntax_tree/node.rb', line 6926 def pretty_print(q) q.group(2, "(", ")") do q.text("qsymbols_beg") q.breakable q.pp(value) end end |