class Keisan::AST::Boolean

Attributes

bool[R]

Public Class Methods

new(bool) click to toggle source
# File lib/keisan/ast/boolean.rb, line 6
def initialize(bool)
  @bool = bool
end

Public Instance Methods

!() click to toggle source
# File lib/keisan/ast/boolean.rb, line 18
def !
  Boolean.new(!bool)
end
and(other) click to toggle source
Calls superclass method
# File lib/keisan/ast/boolean.rb, line 22
def and(other)
  other = other.to_node
  other.is_a?(Boolean) ? Boolean.new(bool && other.bool) : super
end
equal(other) click to toggle source
Calls superclass method
# File lib/keisan/ast/boolean.rb, line 32
def equal(other)
  other = other.to_node
  other.is_a?(Boolean) ? Boolean.new(value == other.value) : super
end
not_equal(other) click to toggle source
Calls superclass method
# File lib/keisan/ast/boolean.rb, line 37
def not_equal(other)
  other = other.to_node
  other.is_a?(Boolean) ? Boolean.new(value != other.value) : super
end
or(other) click to toggle source
Calls superclass method
# File lib/keisan/ast/boolean.rb, line 27
def or(other)
  other = other.to_node
  other.is_a?(Boolean) ? Boolean.new(bool || other.bool) : super
end
true?() click to toggle source
# File lib/keisan/ast/boolean.rb, line 14
def true?
  bool
end
value(context = nil) click to toggle source
# File lib/keisan/ast/boolean.rb, line 10
def value(context = nil)
  bool
end