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
#construct_keys, #format, #pretty_print, #to_json
Constructor Details
#initialize(parts:, location:) ⇒ XString
10313 10314 10315 10316 |
# File 'lib/syntax_tree/node.rb', line 10313 def initialize(parts:, location:) @parts = parts @location = location end |
Instance Attribute Details
#parts ⇒ Object (readonly)
- Array[ StringEmbExpr | StringDVar | TStringContent ]
-
the parts of the
xstring
10311 10312 10313 |
# File 'lib/syntax_tree/node.rb', line 10311 def parts @parts end |
Instance Method Details
#accept(visitor) ⇒ Object
10318 10319 10320 |
# File 'lib/syntax_tree/node.rb', line 10318 def accept(visitor) visitor.visit_xstring(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
10322 10323 10324 |
# File 'lib/syntax_tree/node.rb', line 10322 def child_nodes parts end |
#deconstruct_keys(_keys) ⇒ Object
10328 10329 10330 |
# File 'lib/syntax_tree/node.rb', line 10328 def deconstruct_keys(_keys) { parts: parts, location: location } end |