properly clone the Singleton pattern - did you know that duping doesn‘t copy class methods?
[Source]
# File lib/singleton.rb, line 129 129: def clone 130: Singleton.__init__(super) 131: end
waiting-loop hook
# File lib/singleton.rb, line 146 146: def _instantiate?() 147: while false.equal?(@__instance__) 148: Thread.critical = false 149: sleep(0.08) # timeout 150: Thread.critical = true 151: end 152: @__instance__ 153: end
# File lib/singleton.rb, line 141 141: def _load(str) 142: instance 143: end
ensure that the Singleton pattern is properly inherited
# File lib/singleton.rb, line 136 136: def inherited(sub_klass) 137: super 138: Singleton.__init__(sub_klass) 139: end
[Validate]