Class: FactoryGirl::Evaluator::CallbackRunner

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

Instance Method Summary collapse

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