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:

: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

value[R]
String

the beginning of the symbol

Public Class Methods

new(value:, location:) click to toggle source
# File lib/syntax_tree/node.rb, line 10490
def initialize(value:, location:)
  @value = value
  @location = location
end

Public Instance Methods

===(other) click to toggle source
# File lib/syntax_tree/node.rb, line 10516
def ===(other)
  other.is_a?(SymBeg) && value === other.value
end
accept(visitor) click to toggle source
# File lib/syntax_tree/node.rb, line 10495
def accept(visitor)
  visitor.visit_symbeg(self)
end
child_nodes() click to toggle source
# File lib/syntax_tree/node.rb, line 10499
def child_nodes
  []
end
Also aliased as: deconstruct
copy(value: nil, location: nil) click to toggle source
# File lib/syntax_tree/node.rb, line 10503
def copy(value: nil, location: nil)
  SymBeg.new(
    value: value || self.value,
    location: location || self.location
  )
end
deconstruct()
Alias for: child_nodes
deconstruct_keys(_keys) click to toggle source
# File lib/syntax_tree/node.rb, line 10512
def deconstruct_keys(_keys)
  { value: value, location: location }
end