April 3, 2010
In Ruby, there’s the concept of eigenclasses, or singleton classes. These are classes implicitly defined when attaching methods to a single instance.
From Wikipedia:
Ruby is object-oriented: every data type is an object, including classes and types which many other languages designate as primitives (such as integers, booleans, and “nil”). Every function is a method. Named values (variables) always designate references to objects, not the objects themselves. Ruby supports inheritance with dynamic dispatch, mixins and singleton methods (belonging to, and defined for, a single instance rather than being defined on the class).