Module: Singleton::SingletonClassMethods
Do not use. This module is for internal use only.
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/singleton.rb |
Instance Method Summary
-
#_load(str)
By default calls instance().
- #clone
- #instance
- #inherited(sub_klass) private
- #set_instance(val) private
- #set_mutex(val) private
Instance Method Details
#_load(str)
By default calls instance(). Override to retain singleton state.
#clone
[ GitHub ]#inherited(sub_klass) (private)
[ GitHub ]#instance
[ GitHub ]# File 'lib/singleton.rb', line 126
def instance # :nodoc: @singleton__instance__ || @singleton__mutex__.synchronize { @singleton__instance__ ||= new } end
#set_instance(val) (private)
[ GitHub ]# File 'lib/singleton.rb', line 137
def set_instance(val) @singleton__instance__ = val end
#set_mutex(val) (private)
[ GitHub ]# File 'lib/singleton.rb', line 141
def set_mutex(val) @singleton__mutex__ = val end