Trans
12/20/2006 2:16:00 PM
Jason Mayer wrote:
> I'm sorry for this question, but I'm a newbie and I just started reading the
> Little Book of Ruby. On page 22 it says that "the to_s method is defined
> for the Object class itself". If the Object class has no methods (as your
> irb session shows), then what exactly is meant by the Little Book of Ruby
> statement?
That's a good example. Technically, #to_s is defined in Kernel not
Object. But since everyithing in Kernel is defined ultimately for
Object b/c Kernel is included into Object, then in a round about way
what the book is true. It would be better if it mentioned Kernel's
invovlement though.
t.