Class: SyntaxTree::EmbVar
- Inherits:
-
Object
- Object
- SyntaxTree::EmbVar
- Defined in:
- lib/syntax_tree.rb
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
-
#location ⇒ Object
readonly
- Location
-
the location of this node.
-
#value ⇒ Object
readonly
- String
-
the # used in the string.
Instance Method Summary collapse
-
#initialize(value:, location:) ⇒ EmbVar
constructor
A new instance of EmbVar.
Constructor Details
#initialize(value:, location:) ⇒ EmbVar
Returns a new instance of EmbVar.
5303 5304 5305 5306 |
# File 'lib/syntax_tree.rb', line 5303 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
- Location
-
the location of this node
5301 5302 5303 |
# File 'lib/syntax_tree.rb', line 5301 def location @location end |
#value ⇒ Object (readonly)
- String
-
the # used in the string
5298 5299 5300 |
# File 'lib/syntax_tree.rb', line 5298 def value @value end |