Class: DIY::FactoryFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/diy/factory.rb

Instance Method Summary collapse

Constructor Details

#initialize(clazz) ⇒ FactoryFactory

Returns a new instance of FactoryFactory.



27
28
29
# File 'lib/diy/factory.rb', line 27

def initialize(clazz)
  @class_to_create = clazz
end

Instance Method Details

#create(*args) ⇒ Object



31
32
33
# File 'lib/diy/factory.rb', line 31

def create *args
  @class_to_create.new *args
end