Module: Singleton::SingletonClassMethods

Included in:
RactorLocalSingleton::RactorLocalSingletonClassMethods
Defined in:
lib/singleton.rb

Overview

:nodoc:

Instance Method Summary collapse

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

#cloneObject

:nodoc:



117
118
119
# File 'lib/singleton.rb', line 117

def clone # :nodoc:
  Singleton.__init__(super)
end

#instanceObject

:nodoc:



126
127
128
# File 'lib/singleton.rb', line 126

def instance # :nodoc:
  @singleton__instance__ || @singleton__mutex__.synchronize { @singleton__instance__ ||= new }
end