class SyntaxTree::SymBeg
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.
Attributes
- String
-
the beginning of the symbol
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 10505 def initialize(value:, location:) @value = value @location = location end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 10531 def ===(other) other.is_a?(SymBeg) && value === other.value end
Source
# File lib/syntax_tree/node.rb, line 10510 def accept(visitor) visitor.visit_symbeg(self) end
Source
# File lib/syntax_tree/node.rb, line 10514 def child_nodes [] end
Also aliased as: deconstruct
Source
# File lib/syntax_tree/node.rb, line 10518 def copy(value: nil, location: nil) SymBeg.new( value: value || self.value, location: location || self.location ) end
Source
# File lib/syntax_tree/node.rb, line 10527 def deconstruct_keys(_keys) { value: value, location: location } end