Class: Sol::GetConstantNode

Inherits:
Struct
  • Object
show all
Defined in:
lib/sol/nodes.rb,
lib/sol/interpreter.rb

Overview

Retrieving the value of a constant.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



64
65
66
# File 'lib/sol/nodes.rb', line 64

def name
  @name
end

Instance Method Details

#eval(context) ⇒ Object



131
132
133
134
135
# File 'lib/sol/interpreter.rb', line 131

def eval(context)

	context[name]

end