Module: HashFactoryBuilder

Defined in:
lib/hash_factory_builder.rb

Instance Method Summary collapse

Instance Method Details

#build(class_name, options) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/hash_factory_builder.rb', line 2

def build(class_name, options)
  new_obj = class_name.to_s.pluralize.classify.constantize.new
  new_obj.send :attributes=, options, false
  new_obj.save!
  
  return new_obj
end