Class: Fabricate

Inherits:
Object
  • Object
show all
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, options={}, &block)
  @singletons[name] ||= Fabricate(name, options={}, &block)
  return @singletons[name]
end