Method: Factory#method_missing

Defined in:
lib/factory_girl/factory.rb

#method_missing(name, *args, &block) ⇒ Object

Calls add_attribute using the missing method name as the name of the attribute, so that:

Factory.define :user do |f|
  f.name 'Billy Idol'
end

and:

Factory.define :user do |f|
  f.add_attribute :name, 'Billy Idol'
end

are equivilent.



131
132
133
# File 'lib/factory_girl/factory.rb', line 131

def method_missing (name, *args, &block)
  add_attribute(name, *args, &block)
end