Tuesday, January 08, 2008

Where the singleton methods live in Ruby [R4R 13.1.1]

Ruby, as usual, has a simple answer to this tricky question: An object's singleton methods live in the object's singleton class. Every object really has two classes:
■ The class of which it is an instance
■ Its singleton class

No comments :