Class: SyntaxTree::EmbExprBeg
Overview
EmbExprBeg represents the beginning 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:) ⇒ EmbExprBeg
constructor
A new instance of EmbExprBeg.
Methods inherited from Node
#construct_keys, #format, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:) ⇒ EmbExprBeg
Returns a new instance of EmbExprBeg.
4230 4231 4232 4233 |
# File 'lib/syntax_tree/node.rb', line 4230 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#value ⇒ Object (readonly)
- String
-
the #{ used in the string
4228 4229 4230 |
# File 'lib/syntax_tree/node.rb', line 4228 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
4235 4236 4237 |
# File 'lib/syntax_tree/node.rb', line 4235 def accept(visitor) visitor.visit_embexpr_beg(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
4239 4240 4241 |
# File 'lib/syntax_tree/node.rb', line 4239 def child_nodes [] end |
#deconstruct_keys(_keys) ⇒ Object
4245 4246 4247 |
# File 'lib/syntax_tree/node.rb', line 4245 def deconstruct_keys(_keys) { value: value, location: location } end |