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
-
#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.
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.
4908 4909 4910 4911 |
# File 'lib/syntax_tree/node.rb', line 4908 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
- Location
-
the location of this node
4906 4907 4908 |
# File 'lib/syntax_tree/node.rb', line 4906 def location @location end |
#value ⇒ Object (readonly)
- String
-
the # used in the string
4903 4904 4905 |
# File 'lib/syntax_tree/node.rb', line 4903 def value @value end |