Module: Singleton::SingletonClassMethods
- Defined in:
- lib/singleton.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#_load(str) ⇒ Object
By default calls instance().
-
#clone ⇒ Object
:nodoc:.
-
#instance ⇒ Object
:nodoc:.
Instance Method Details
#_load(str) ⇒ Object
By default calls instance(). Override to retain singleton state.
122 123 124 |
# File 'lib/singleton.rb', line 122 def _load(str) instance end |
#clone ⇒ Object
:nodoc:
117 118 119 |
# File 'lib/singleton.rb', line 117 def clone # :nodoc: Singleton.__init__(super) end |
#instance ⇒ Object
:nodoc:
126 127 128 |
# File 'lib/singleton.rb', line 126 def instance # :nodoc: @singleton__instance__ || @singleton__mutex__.synchronize { @singleton__instance__ ||= new } end |