by gwright · 13y ago · 0 comments
For quite a while there was little agreement on this name because there was no standard method that could be called to return the singleton class and therefore no agreed upon name. The only access was via syntax:
(class <<object; self; end)
The results of this expression were called metaclass, eigenclass, singleton class, and probably a few more names.There is now a standard method:
object.singleton_class
and so, for the most part, the naming confusion is fading away.At a more technical, detailed level, however, the Ruby core team uses both the term "metaclass" (in the same sense Smalltalk uses it - the class of a class), and the term "singleton" (the hidden class of a single object instance). You can see what I mean by looking through the MRI class.c source file.