The Singleton Module and Its Pattern In Ruby
summary
Shows that Ruby’s stdlib Singleton module makes new and allocate private and supplies an instance method while forbidding clone/dup, demonstrates using Singletons for logging and config where data flows one way, builds examples: class-level Singleton methods for cats, per-object Singleton class to add PK’s snore, and a Schrödinger’s cat private-status fix by manipulating the Singleton class on an object. Argues the implementation ties to Ruby’s message dispatch and is pragmatically useful.
AI-written summary · about
chapters (5)
- 0:00Start
- 3:37What is The Singleton Pattern?
- 6:55Concerns
- 9:10Common Appropriate Use Cases
- 17:40Singleton class
related talks
29mThe Case of the Missing Method: A Ruby Mystery Story
23mSticky Ruby
34mThe Case of the Missing Method — A Ruby Mystery Story
33mThe Case Of The Missing Method - A Ruby Mystery Story
30mRuby Techniques by Example
29mMessenger: The (Complete) Story of Method Lookup
41mFunctional Patterns in Ruby
33mVenturing into the Spooky Science of Ruby
