On Dec 2, 2010, at 6:59 PM, Tony Arcieri wrote:

> On Thu, Dec 2, 2010 at 4:55 PM, Gary Wright <gwtmp01 / mac.com> wrote:
>=20
>> Because some classes have behavior that is unique to the class.
>>=20
>=20
> 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=