Hi all,
I am new to Ruby and am trying to overload "+" operator on Integer
class, without success.
class TestNum < Integer
def +(other)
self.value - other
end
end
puts TestNum.new(5)+5; # should return 0
I know that it should be simple, but.... any help appreciated.
--
Bojan Mihelac
Informatika Mihelac, Bojan Mihelac s.p. | www.informatikamihelac.com
-> tools, scripts, tricks from our code lab: http://source.mihelac.org