Tim Hunter
12/30/2006 2:12:00 AM
chen li wrote:
> --- Timothy Hunter <TimHunter@nc.rr.com> wrote:
>
>> puts calls to_s on each object that it writes. If
>> you don't supply a
>> to_s method for your class then the to_s method in
>> your class's
>> superclass will be used. Since the superclass is
>> Object, the Object#to_s
>> method is used. This version of to_s simply formats
>> the object's class
>> and its id as a string.
>>
>>
>> ri Object#to_s for more information.
>>
>
> What I don't understand is that I don't call Song#to_s
> in my script why does it affect my codes?
>
puts calls to_s