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.
5641 5642 5643 5644 |
# File 'lib/syntax_tree.rb', line 5641 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
- Location
-
the location of this node
5639 5640 5641 |
# File 'lib/syntax_tree.rb', line 5639 def location @location end |
#value ⇒ Object (readonly)
- String
-
the # used in the string
5636 5637 5638 |
# File 'lib/syntax_tree.rb', line 5636 def value @value end |