lib/factory_boy.rb
# name can be :user or User, there could also be passed
# class option
name can be :user or User, there could also be passed
class option
name can be : user or User there could also be passed class option
def define_factory(name, options = {}, &block)
      klass = options.fetch(:class) { const_get(symbol_to_class_name(name)) }
      factory_instance = DefinitionProxy.new
      register_factory(name, factory_instance, klass)
      factory_instance.instance_eval(&block) if block_given?
    end
def define_factory ( name , options = { } , & block ) klass = options . fetch ( :class ) { const_get ( symbol_to_class_name ( name ) ) } factory_instance = DefinitionProxy . new register_factory ( name , factory_instance , klass ) factory_instance . instance_eval ( & block ) if block_given? end
name can be :user or User, there could also be passed
class option
name can be : user or User there could also be passed class option
name
<not_specific>
options
<not_specific>
block
<not_specific>