Method: Code::Object::Integer#code_plus

Defined in:
lib/code/object/integer.rb

#code_plus(other) ⇒ Object



283
284
285
286
287
288
289
290
291
# File 'lib/code/object/integer.rb', line 283

def code_plus(other)
  if other.is_a?(Integer)
    Integer.new(raw + other.raw)
  elsif other.is_a?(Decimal)
    Decimal.new(raw + other.raw)
  else
    String.new(to_s + other.to_s)
  end
end