Module: Keisan::AST::DateTimeMethods
Instance Method Summary collapse
- #+(other) ⇒ Object
- #<(other) ⇒ Object
- #<=(other) ⇒ Object
- #>(other) ⇒ Object
- #>=(other) ⇒ Object
- #equal(other) ⇒ Object
- #not_equal(other) ⇒ Object
Instance Method Details
#+(other) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# 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) ⇒ Object
24 25 26 27 28 29 30 31 32 |
# 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) ⇒ Object
44 45 46 47 48 49 50 51 52 |
# 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) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# 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) ⇒ Object
34 35 36 37 38 39 40 41 42 |
# 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 |