# File lib/object_daddy.rb, line 28 def spawn(args = {}) gather_exemplars if @concrete_subclass_name return block_given? \ ? const_get(@concrete_subclass_name).spawn(args) {|instance| yield instance} \ : const_get(@concrete_subclass_name).spawn(args) end generate_values(args) instance = new args.each_pair do |attribute, value| instance.send("#{attribute}=", value) # support setting of mass-assignment protected attributes end yield instance if block_given? instance end