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.



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

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



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

def value
  @value
end

Instance Method Details

#eval(context) ⇒ Object



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

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