Class: SyntaxTree::XString
Overview
XString represents the contents of an XStringLiteral.
`ls`
Instance Attribute Summary collapse
-
#parts ⇒ Object
readonly
- Array[ StringEmbExpr | StringDVar | TStringContent ]
-
the parts of the xstring.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(parts:, location:) ⇒ XString
constructor
A new instance of XString.
Methods inherited from Node
#format, #pretty_print, #to_json
Constructor Details
#initialize(parts:, location:) ⇒ XString
Returns a new instance of XString.
9196 9197 9198 9199 |
# File 'lib/syntax_tree/node.rb', line 9196 def initialize(parts:, location:) @parts = parts @location = location end |
Instance Attribute Details
#parts ⇒ Object (readonly)
- Array[ StringEmbExpr | StringDVar | TStringContent ]
-
the parts of the
xstring
9194 9195 9196 |
# File 'lib/syntax_tree/node.rb', line 9194 def parts @parts end |
Instance Method Details
#accept(visitor) ⇒ Object
9201 9202 9203 |
# File 'lib/syntax_tree/node.rb', line 9201 def accept(visitor) visitor.visit_xstring(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
9205 9206 9207 |
# File 'lib/syntax_tree/node.rb', line 9205 def child_nodes parts end |
#deconstruct_keys(keys) ⇒ Object
9211 9212 9213 |
# File 'lib/syntax_tree/node.rb', line 9211 def deconstruct_keys(keys) { parts: parts, location: location } end |