Hi,

In message "User-defined class coercion?"
    on 03/08/06, "Mark J. Reed" <markjreed / mail.com> writes:

|I would like to define my own class that works as a number when
|treated as a number but also has other properties.  Can I do this?
|If so, how?  

By defining "coerce" method:

  class Foo
     def coerce(other)
       ...
       return converted_other, self
     end
  end

							matz.