Method: Keisan::AST::Number#+

Defined in:
lib/keisan/ast/number.rb

#+(other) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/keisan/ast/number.rb', line 27

def +(other)
  other = other.to_node
  case other
  when Number
    Number.new(value + other.value)
  when Date
    Date.new(other.value + value)
  when Time
    Time.new(other.value + value)
  else
    super
  end
end