From: Gary Wright Date: 2010-12-03T02:23:34+09:00 Subject: Re: Singleton class, metaclass, eigenclass: what do they mean? On Dec 2, 2010, at 11:47 AM, Intransition wrote: > On Dec 2, 12:25 am, Tony Arcieri wrote: >> Every time I think I have my head around what these terms mean I seem to run >> across someone with a completely different definition. >> >> My understanding was that the singleton class is what you obtain when you >> call self.class in instance scope, and that metaclass and eigenclass >> are interchangeable terms for what you obtain if you call class << self; >> self; end in instance scope. >> >> Is this correct? Do you have a different definition? > > Technically they are all the same. Perhaps it was the original question that was confusing but they are not all the same. There are two different situations in the examples given by the original poster: 1) object.class in any context is the class of which 'object' is an instance self.class is just a particular example of this for 'self' 2) Ruby 1.9.2: object.singleton_class in any context is the (perhaps newly created) singleton class for 'object' self.singleton_class is again just a particular example of this for 'self' Prior to Ruby 1.9.2: The expression, (class <