Class: PrimitiveNode

Inherits:
Object
  • Object
show all
Defined in:
lib/nodes.rb

Overview

Superclass for primitive data-types.

Direct Known Subclasses

BoolNode, DigitNode, IdentifierNode, StringNode

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ PrimitiveNode

Returns a new instance of PrimitiveNode.



352
353
354
# File 'lib/nodes.rb', line 352

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



351
352
353
# File 'lib/nodes.rb', line 351

def value
  @value
end

Instance Method Details

#evaluate(scope) ⇒ Object



356
357
358
# File 'lib/nodes.rb', line 356

def evaluate(scope)
  return @value
end