Class: DIY::FactoryFactory
- Inherits:
-
Object
- Object
- DIY::FactoryFactory
- Defined in:
- lib/diy/factory.rb
Instance Method Summary collapse
- #create(*args) ⇒ Object
-
#initialize(clazz) ⇒ FactoryFactory
constructor
A new instance of FactoryFactory.
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 |