class SyntaxTree::XStringLiteral
XStringLiteral
represents a string that gets executed.
`ls`
Attributes
- Array[
StringEmbExpr
|StringDVar
|TStringContent
] -
the parts of the
xstring
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 12246 def initialize(parts:, location:) @parts = parts @location = location @comments = [] end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 12283 def ===(other) other.is_a?(XStringLiteral) && ArrayMatch.call(parts, other.parts) end
Source
# File lib/syntax_tree/node.rb, line 12252 def accept(visitor) visitor.visit_xstring_literal(self) end
Source
# File lib/syntax_tree/node.rb, line 12256 def child_nodes parts end
Also aliased as: deconstruct
Source
# File lib/syntax_tree/node.rb, line 12260 def copy(parts: nil, location: nil) node = XStringLiteral.new( parts: parts || self.parts, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node end
Source
# File lib/syntax_tree/node.rb, line 12273 def deconstruct_keys(_keys) { parts: parts, location: location, comments: comments } end
Source
# File lib/syntax_tree/node.rb, line 12277 def format(q) q.text("`") q.format_each(parts) q.text("`") end