Class: SyntaxTree::StringContent
Overview
StringContent represents the contents of a string-like value.
"string"
Instance Attribute Summary collapse
-
#parts ⇒ Object
readonly
- Array[ StringEmbExpr | StringDVar | TStringContent ]
-
the parts of the string.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(_keys) ⇒ Object
-
#initialize(parts:, location:) ⇒ StringContent
constructor
A new instance of StringContent.
Methods inherited from Node
#construct_keys, #format, #pretty_print, #to_json
Constructor Details
#initialize(parts:, location:) ⇒ StringContent
Returns a new instance of StringContent.
8090 8091 8092 8093 |
# File 'lib/syntax_tree/node.rb', line 8090 def initialize(parts:, location:) @parts = parts @location = location end |
Instance Attribute Details
#parts ⇒ Object (readonly)
- Array[ StringEmbExpr | StringDVar | TStringContent ]
-
the parts of the
string
8088 8089 8090 |
# File 'lib/syntax_tree/node.rb', line 8088 def parts @parts end |
Instance Method Details
#accept(visitor) ⇒ Object
8095 8096 8097 |
# File 'lib/syntax_tree/node.rb', line 8095 def accept(visitor) visitor.visit_string_content(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
8099 8100 8101 |
# File 'lib/syntax_tree/node.rb', line 8099 def child_nodes parts end |
#deconstruct_keys(_keys) ⇒ Object
8105 8106 8107 |
# File 'lib/syntax_tree/node.rb', line 8105 def deconstruct_keys(_keys) { parts: parts, location: location } end |