From: Dmitri Colebatch Date: 2003-01-22T07:29:33+09:00 Subject: Re: Overloading operators I was also wondering if there is a way to implement += total = Amount.aud(300) total += Amount.aud(500) total -> AUD 800 ? cheers dim Philip Mak wrote: > Is there a shortcut for writing all this? > > def +(otherField) > @value + otherField.value > end > > def -(otherField) > @value - otherField.value > end > > def *(otherField) > @value * otherField.value > end > > def /(otherField) > @value / otherField.value > end >