Class: SyntaxTree::EmbVar
Overview
EmbVar represents the use of shorthand interpolation for an instance, class, or global variable into a parent node that accepts string content (like a string or regular expression).
"#@variable"
In the example above, an EmbVar node represents the # because it forces
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
- String
-
the # used in the string.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(value:, location:) ⇒ EmbVar
constructor
A new instance of EmbVar.
Methods inherited from Node
#child_nodes, #deconstruct, #deconstruct_keys, #format, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:) ⇒ EmbVar
Returns a new instance of EmbVar.
4746 4747 4748 4749 |
# File 'lib/syntax_tree/node.rb', line 4746 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#value ⇒ Object (readonly)
- String
-
the # used in the string
4744 4745 4746 |
# File 'lib/syntax_tree/node.rb', line 4744 def value @value end |