Class: Wellness::Factory
- Inherits:
-
Object
- Object
- Wellness::Factory
- Defined in:
- lib/wellness/factory.rb
Overview
A simple class that builds the provided class with the provided arguments
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(klass, *args) ⇒ Factory
constructor
A new instance of Factory.
Constructor Details
#initialize(klass, *args) ⇒ Factory
Returns a new instance of Factory.
5 6 7 8 |
# File 'lib/wellness/factory.rb', line 5 def initialize(klass, *args) @klass = klass @args = args end |
Instance Method Details
#build ⇒ Object
10 11 12 |
# File 'lib/wellness/factory.rb', line 10 def build @klass.new(*@args) end |