Class: FactoryGirl::Factory::Runner
- Inherits:
-
Object
- Object
- FactoryGirl::Factory::Runner
- Defined in:
- lib/factory_girl/factory.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Runner
constructor
A new instance of Runner.
- #run(overrides = {}) ⇒ Object
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( = {}) @attributes = [:attributes] @callbacks = [:callbacks] @to_create = [:to_create] @build_class = [:build_class] @proxy_class = [: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 |