From: 7stud -- Date: 2008-02-15T08:19:53+09:00 Subject: Re: object specific methods and id UpsNDowns wrote: > Hi, > > If I create an object specifc method foo on my string instance obj, a > new anonymous class (the singleton, I gather) is created and obj is > considered an instance of that. > > Also, every thing is an object (event classes). So how come, > obj.class.id > and > "someString".class.id > is the same? > They aren't: puts String.class puts 'hello'.class --output:-- Class String puts String.class.object_id puts 'hello'.class.object_id --output:-- 110210 105460 -- Posted via http://www.ruby-forum.com/.