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
#format, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:) ⇒ EmbExprEnd
Returns a new instance of EmbExprEnd.
4150 4151 4152 4153 |
# File 'lib/syntax_tree/node.rb', line 4150 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#value ⇒ Object (readonly)
- String
-
the } used in the string
4148 4149 4150 |
# File 'lib/syntax_tree/node.rb', line 4148 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
4155 4156 4157 |
# File 'lib/syntax_tree/node.rb', line 4155 def accept(visitor) visitor.visit_embexpr_end(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
4159 4160 4161 |
# File 'lib/syntax_tree/node.rb', line 4159 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
4165 4166 4167 |
# File 'lib/syntax_tree/node.rb', line 4165 def deconstruct_keys(keys) { value: value, location: location } end |