Class: SyntaxTree::EmbExprEnd
- Inherits:
-
Node
- Object
- Node
- SyntaxTree::EmbExprEnd
show all
- Defined in:
- lib/syntax_tree/node.rb
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
Attributes inherited from Node
#location
Instance Method Summary
collapse
Methods inherited from Node
#construct_keys, #end_char, #format, #pretty_print, #start_char, #to_json, #to_mermaid
Constructor Details
#initialize(value:, location:) ⇒ EmbExprEnd
Returns a new instance of EmbExprEnd.
5083
5084
5085
5086
|
# File 'lib/syntax_tree/node.rb', line 5083
def initialize(value:, location:)
@value = value
@location = location
end
|
Instance Attribute Details
#value ⇒ Object
- String
-
the } used in the string
5081
5082
5083
|
# File 'lib/syntax_tree/node.rb', line 5081
def value
@value
end
|
Instance Method Details
#===(other) ⇒ Object
5109
5110
5111
|
# File 'lib/syntax_tree/node.rb', line 5109
def ===(other)
other.is_a?(EmbExprEnd) && value === other.value
end
|
#accept(visitor) ⇒ Object
5088
5089
5090
|
# File 'lib/syntax_tree/node.rb', line 5088
def accept(visitor)
visitor.visit_embexpr_end(self)
end
|
#child_nodes ⇒ Object
Also known as:
deconstruct
5092
5093
5094
|
# File 'lib/syntax_tree/node.rb', line 5092
def child_nodes
[]
end
|
#copy(value: nil, location: nil) ⇒ Object
5096
5097
5098
5099
5100
5101
|
# File 'lib/syntax_tree/node.rb', line 5096
def copy(value: nil, location: nil)
EmbExprEnd.new(
value: value || self.value,
location: location || self.location
)
end
|
#deconstruct_keys(_keys) ⇒ Object
5105
5106
5107
|
# File 'lib/syntax_tree/node.rb', line 5105
def deconstruct_keys(_keys)
{ value: value, location: location }
end
|