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.
5604 5605 5606 5607 |
# File 'lib/syntax_tree.rb', line 5604 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
- Location
-
the location of this node
5602 5603 5604 |
# File 'lib/syntax_tree.rb', line 5602 def location @location end |
#value ⇒ Object (readonly)
- String
-
the # used in the string
5599 5600 5601 |
# File 'lib/syntax_tree.rb', line 5599 def value @value end |