class SyntaxTree::EmbVar
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 @variable to be interpolated.
Attributes
- String
-
the # used in the string
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 5141 def initialize(value:, location:) @value = value @location = location end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 5167 def ===(other) other.is_a?(EmbVar) && value === other.value end
Source
# File lib/syntax_tree/node.rb, line 5146 def accept(visitor) visitor.visit_embvar(self) end
Source
# File lib/syntax_tree/node.rb, line 5150 def child_nodes [] end
Also aliased as: deconstruct
Source
# File lib/syntax_tree/node.rb, line 5154 def copy(value: nil, location: nil) EmbVar.new( value: value || self.value, location: location || self.location ) end
Source
# File lib/syntax_tree/node.rb, line 5163 def deconstruct_keys(_keys) { value: value, location: location } end