Class: Kalc::Ast::BooleanValue

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ BooleanValue

Returns a new instance of BooleanValue.



72
73
74
# File 'lib/kalc/ast.rb', line 72

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



70
71
72
# File 'lib/kalc/ast.rb', line 70

def value
  @value
end

Instance Method Details

#eval(context) ⇒ Object



76
77
78
# File 'lib/kalc/ast.rb', line 76

def eval(context)
  @value == 'TRUE' ? true : false
end