class SyntaxTree::WordsBeg

WordsBeg represents the beginning of a string literal array with interpolation.

%W[one two three]

In the snippet above, a WordsBeg would be created with the value of “%W[”. Note that these kinds of arrays can start with a lot of different delimiter types (e.g., %W| or %W<).

Attributes

value[R]
String

the start of the word literal array

Public Class Methods

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

Public Instance Methods

===(other) click to toggle source
# File lib/syntax_tree/node.rb, line 12170
def ===(other)
  other.is_a?(WordsBeg) && value === other.value
end
accept(visitor) click to toggle source
# File lib/syntax_tree/node.rb, line 12149
def accept(visitor)
  visitor.visit_words_beg(self)
end
child_nodes() click to toggle source
# File lib/syntax_tree/node.rb, line 12153
def child_nodes
  []
end
Also aliased as: deconstruct
copy(value: nil, location: nil) click to toggle source
# File lib/syntax_tree/node.rb, line 12157
def copy(value: nil, location: nil)
  WordsBeg.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 12166
def deconstruct_keys(_keys)
  { value: value, location: location }
end