module Keisan::AST::DateTimeMethods

Public Instance Methods

+(other) click to toggle source
Calls superclass method
# File lib/keisan/ast/date_time_methods.rb, line 4
def +(other)
  other = other.to_node
  case other
  when Number
    self.class.new(value + other.value)
  else
    super
  end
end
<(other) click to toggle source
Calls superclass method
# File lib/keisan/ast/date_time_methods.rb, line 24
def <(other)
  other = other.to_node
  case other
  when self.class
    Boolean.new(value.to_time < other.value.to_time)
  else
    super
  end
end
<=(other) click to toggle source
Calls superclass method
# File lib/keisan/ast/date_time_methods.rb, line 44
def <=(other)
  other = other.to_node
  case other
  when self.class
    Boolean.new(value.to_time <= other.value.to_time)
  else
    super
  end
end
>(other) click to toggle source
Calls superclass method
# File lib/keisan/ast/date_time_methods.rb, line 14
def >(other)
  other = other.to_node
  case other
  when self.class
    Boolean.new(value.to_time > other.value.to_time)
  else
    super
  end
end
>=(other) click to toggle source
Calls superclass method
# File lib/keisan/ast/date_time_methods.rb, line 34
def >=(other)
  other = other.to_node
  case other
  when self.class
    Boolean.new(value.to_time >= other.value.to_time)
  else
    super
  end
end
equal(other) click to toggle source
Calls superclass method
# File lib/keisan/ast/date_time_methods.rb, line 54
def equal(other)
  other = other.to_node
  case other
  when self.class
    Boolean.new(value.to_time == other.value.to_time)
  else
    super
  end
end
not_equal(other) click to toggle source
Calls superclass method
# File lib/keisan/ast/date_time_methods.rb, line 64
def not_equal(other)
  other = other.to_node
  case other
  when self.class
    Boolean.new(value.to_time != other.value.to_time)
  else
    super
  end
end