Files

9 lines
772 B
Markdown
Raw Permalink Normal View History

2026-01-13 15:03:30 +01:00
# Singleton Classes
2026-01-14 21:09:41 +01:00
A singleton class in Ruby is a special kind of class that is associated with a single object. It allows you to define methods that are specific to that particular object, without affecting other objects of the same class. Think of it as a way to add unique behavior to an individual object instance.
Visit the following resources to learn more:
- [@article@Explaining Ruby's Singleton Class (Eigenclass) to confused beginners](https://dev.to/samuelfaure/explaining-ruby-s-singleton-class-eigenclass-to-confused-beginners-cep)
- [@article@Better Know A Ruby Thing: Singleton Classes](https://noelrappin.com/blog/2025/01/better-know-a-ruby-thing-singleton-classes/)
- [@video@The Singleton Pattern in Ruby](https://www.youtube.com/watch?v=IP3I_t2rR6A)