class SyntaxTree::XString

XString represents the contents of an XStringLiteral.

`ls`

Attributes

parts[R]
Array[ StringEmbExpr | StringDVar | TStringContent ]

the parts of the

xstring

Public Class Methods

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

Public Instance Methods

===(other) click to toggle source
# File lib/syntax_tree/node.rb, line 12210
def ===(other)
  other.is_a?(XString) && ArrayMatch.call(parts, other.parts)
end
accept(visitor) click to toggle source
# File lib/syntax_tree/node.rb, line 12189
def accept(visitor)
  visitor.visit_xstring(self)
end
child_nodes() click to toggle source
# File lib/syntax_tree/node.rb, line 12193
def child_nodes
  parts
end
Also aliased as: deconstruct
copy(parts: nil, location: nil) click to toggle source
# File lib/syntax_tree/node.rb, line 12197
def copy(parts: nil, location: nil)
  XString.new(
    parts: parts || self.parts,
    location: location || self.location
  )
end
deconstruct()
Alias for: child_nodes
deconstruct_keys(_keys) click to toggle source
# File lib/syntax_tree/node.rb, line 12206
def deconstruct_keys(_keys)
  { parts: parts, location: location }
end