Class: SyntaxTree::EmbExprEnd
Overview
EmbExprEnd represents the ending token for using interpolation inside of a parent node that accepts string content (like a string or regular expression).
"Hello, #{person}!"
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
- String
-
the } used in the string.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(_keys) ⇒ Object
-
#initialize(value:, location:) ⇒ EmbExprEnd
constructor
A new instance of EmbExprEnd.
Methods inherited from Node
#construct_keys, #format, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:) ⇒ EmbExprEnd
4369 4370 4371 4372 |
# File 'lib/syntax_tree/node.rb', line 4369 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#value ⇒ Object (readonly)
- String
-
the } used in the string
4367 4368 4369 |
# File 'lib/syntax_tree/node.rb', line 4367 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
4374 4375 4376 |
# File 'lib/syntax_tree/node.rb', line 4374 def accept(visitor) visitor.visit_embexpr_end(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
4378 4379 4380 |
# File 'lib/syntax_tree/node.rb', line 4378 def child_nodes [] end |
#deconstruct_keys(_keys) ⇒ Object
4384 4385 4386 |
# File 'lib/syntax_tree/node.rb', line 4384 def deconstruct_keys(_keys) { value: value, location: location } end |