Class: FactoryGirl::Factory::Runner

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

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Runner

Returns a new instance of Runner.



147
148
149
150
151
152
153
154
155
# File 'lib/factory_girl/factory.rb', line 147

def initialize(options = {})
  @attributes  = options[:attributes]
  @callbacks   = options[:callbacks]
  @to_create   = options[:to_create]
  @build_class = options[:build_class]
  @proxy_class = options[:proxy_class]

  @overrides   = {}
end

Instance Method Details

#run(overrides = {}) ⇒ Object



157
158
159
160
161
162
163
164
# File 'lib/factory_girl/factory.rb', line 157

def run(overrides = {})
  @overrides = overrides.symbolize_keys

  apply_attributes
  apply_remaining_overrides

  proxy.result(@to_create)
end