Joel VanderWerf
8/22/2006 11:21:00 PM
Grab Mail wrote:
> class Integer
>
> def to_s
> '9'
> end
>
> end
>
> puts 5.to_s
>
> I'm still getting 5.
>
#to_s is defined in Fixnum, a subclass of Integer. Try this:
class Fixnum
def to_s
'9'
end
end
puts 5.to_s
--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407