harryo / zipworld.com.au (Harry Ohlsen) writes:

> I've written a number of numeric types that I want to be able to use
> anywhere I could a Fixnum or Float.  So, I've written code for each of
> +, -, * and / that check what the type of the "other" argument is and
> do appropriate things.

There's a built-in mechanism called 'coerce' that might do what you
want.

There's an example at

 http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/~poffice/mail/ruby-talk/9587


Regards


Dave