Better Know A Ruby Thing: Singleton Classes – Noel Rappin Writes Here
31-Jan-2025 4
It is time to Better Know what is perhaps the Ruby-iest of Ruby things, a feature that didn’t even have an official name for several years, despite being critical to Ruby’s Object-Oriented semantics. (It only just now occurs to me that there was no official name in English, I wonder what the Japanese name for it was…).
Yes, it’s the singleton class.
Which isn’t really a singleton. Or really a class. It is the “grape-nuts cereal” of Ruby features.
The singleton class has been known by other unofficial names over the years. It’s been called a “metaclass” although technically it is not a metaclass, it has been called an “eigenclass”, a name I always favored because nobody knows what an eigenclass is, so whose to say whether it is one.
Better Know A Ruby Thing: Singleton Classes – Noel Rappin Writes Here #ruby #rubydeveloper #rubyonrails #Better #Thing: #Singleton #Classes #Rappin #Writes #classes https://rubyonrails.ba/link/better-know-a-ruby-thing-singleton-classes-noel-rappin-writes-here