Class: Fictive::Text::ReferenceNode

Inherits:
Object
  • Object
show all
Defined in:
lib/fictive/text/compiler.rb

Instance Method Summary collapse

Constructor Details

#initialize(reference, symbol_table) ⇒ ReferenceNode

Returns a new instance of ReferenceNode.



105
106
107
108
# File 'lib/fictive/text/compiler.rb', line 105

def initialize(reference, symbol_table)
  @reference = reference.to_sym
  @symbol_table = symbol_table
end

Instance Method Details

#evaluateObject



110
111
112
# File 'lib/fictive/text/compiler.rb', line 110

def evaluate
  @symbol_table.fetch(@reference)
end