Module: GollyUtils::Singleton
- Defined in:
- lib/golly-utils/singleton.rb
Overview
Makes the including class a singleton.
Much like Ruby's Singleton module, with extra features.
Features:
- Target class includes Ruby's
Singletonmodule too. - Class methods are added to the target class that delegate to the singleton instance.
- A convenience method def_accessor is provided to create an accessor in the calling
class, as per
attr_accessor, except that the value defaults to the singleton instance.
Defined Under Namespace
Modules: ClassMethods