Class: FactoryGirl::Evaluator::CallbackRunner
- Inherits:
-
Object
- Object
- FactoryGirl::Evaluator::CallbackRunner
- Defined in:
- lib/factory_girl/evaluator.rb
Instance Method Summary collapse
-
#initialize(callbacks, evaluator) ⇒ CallbackRunner
constructor
A new instance of CallbackRunner.
- #update(name, result_instance) ⇒ Object
Constructor Details
#initialize(callbacks, evaluator) ⇒ CallbackRunner
Returns a new instance of CallbackRunner.
45 46 47 48 |
# File 'lib/factory_girl/evaluator.rb', line 45 def initialize(callbacks, evaluator) @callbacks = callbacks @evaluator = evaluator end |
Instance Method Details
#update(name, result_instance) ⇒ Object
50 51 52 53 54 |
# File 'lib/factory_girl/evaluator.rb', line 50 def update(name, result_instance) @callbacks.select {|callback| callback.name == name }.each do |callback| callback.run(result_instance, @evaluator) end end |