Class: SyntaxTree::EmbVar

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#locationObject (readonly)

Location

the location of this node



5639
5640
5641
# File 'lib/syntax_tree.rb', line 5639

def location
  @location
end

#valueObject (readonly)

String

the # used in the string



5636
5637
5638
# File 'lib/syntax_tree.rb', line 5636

def value
  @value
end