From: Gary Wright Date: 2010-12-03T13:05:20+09:00 Subject: Re: Singleton class, metaclass, eigenclass: what do they mean? On Dec 2, 2010, at 6:59 PM, Tony Arcieri wrote: > On Thu, Dec 2, 2010 at 4:55 PM, Gary Wright wrote: > >> Because some classes have behavior that is unique to the class. >> > > Earlier I asked how this was implemented... apparently "class objects" have > instance-specific behavior in their "singleton class" which takes the form > of "singleton methods"? Yes, but this is not special behavior for class objects. Per-object behavior in Ruby is implemented by adding methods to the singleton class for the object. It doesn't matter if the object is a string, an array, or a class. The per-object methods (i.e. singleton methods) are all implemented in the same way, via instance methods of the singleton class for the object. If the object happens to be a class object then those singleton methods are commonly known as 'class methods' but that is just a naming convention. Gary Wright