Class: Fabricate
- Inherits:
-
Object
- Object
- Fabricate
- Defined in:
- lib/roqua/core_ext/fabrication/singleton.rb
Class Method Summary collapse
Class Method Details
.clear_singletons! ⇒ Object
7 8 9 |
# File 'lib/roqua/core_ext/fabrication/singleton.rb', line 7 def self.clear_singletons! @singletons = {} end |
.singleton(name, options = {}, &block) ⇒ Object
2 3 4 5 |
# File 'lib/roqua/core_ext/fabrication/singleton.rb', line 2 def self.singleton(name, ={}, &block) @singletons[name] ||= Fabricate(name, ={}, &block) return @singletons[name] end |