Class: Wellness::Factory

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

Overview

A simple class that builds the provided class with the provided arguments

Author:

  • Matthew A. Johnston (warmwaffles)

Instance Method Summary collapse

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

#buildObject



10
11
12
# File 'lib/wellness/factory.rb', line 10

def build
  @klass.new(*@args)
end