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
- String
-
the start of the word literal array
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 12163 def initialize(value:, location:) @value = value @location = location end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 12189 def ===(other) other.is_a?(WordsBeg) && value === other.value end
Source
# File lib/syntax_tree/node.rb, line 12168 def accept(visitor) visitor.visit_words_beg(self) end
Source
# File lib/syntax_tree/node.rb, line 12172 def child_nodes [] end
Also aliased as: deconstruct
Source
# File lib/syntax_tree/node.rb, line 12176 def copy(value: nil, location: nil) WordsBeg.new( value: value || self.value, location: location || self.location ) end
Source
# File lib/syntax_tree/node.rb, line 12185 def deconstruct_keys(_keys) { value: value, location: location } end