Class: Sol::SetConstantNode

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

Overview

Setting 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



67
68
69
# File 'lib/sol/nodes.rb', line 67

def name
  @name
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



67
68
69
# File 'lib/sol/nodes.rb', line 67

def value
  @value
end

Instance Method Details

#eval(context) ⇒ Object



141
142
143
144
145
# File 'lib/sol/interpreter.rb', line 141

def eval(context)

	context[name] = value.eval(context)

end