From: James Coglan Date: 2008-07-09T16:09:27+09:00 Subject: Re: type specific operator ------=_Part_762_10385112.1215587597336 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline > > > Is there any type specific operator facility available in ruby? You can overload operators on specific classes if you want custom behaviour: class Foo attr_reader :size def initialize(n) @size = n end def +(other) Foo.new(@size + other.size) end end Foo.new(9) + Foo.new(3) # => # ------=_Part_762_10385112.1215587597336--