Class: SyntaxTree::SymBeg
Overview
SymBeg represents the beginning of a symbol literal.
:symbol
SymBeg is also used for dynamic symbols, as in:
:"symbol"
Finally, SymBeg is also used for symbols using the %s syntax, as in:
%s[symbol]
The value of this node is a string. In most cases (as in the first example above) it will contain just “:”. In the case of dynamic symbols it will contain “:‘” or “:\”“. In the case of %s symbols, it will contain the start of the symbol including the %s and the delimiter.
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
- Location
-
the location of this node.
-
#value ⇒ Object
readonly
- String
-
the beginning of the symbol.
Instance Method Summary collapse
-
#initialize(value:, location:) ⇒ SymBeg
constructor
A new instance of SymBeg.
Methods inherited from Node
#child_nodes, #deconstruct, #deconstruct_keys, #format, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:) ⇒ SymBeg
Returns a new instance of SymBeg.
9919 9920 9921 9922 |
# File 'lib/syntax_tree/node.rb', line 9919 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
- Location
-
the location of this node
9917 9918 9919 |
# File 'lib/syntax_tree/node.rb', line 9917 def location @location end |
#value ⇒ Object (readonly)
- String
-
the beginning of the symbol
9914 9915 9916 |
# File 'lib/syntax_tree/node.rb', line 9914 def value @value end |