Class: FactoryGirl::CallbacksObserver Private

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

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(callbacks, evaluator) ⇒ CallbacksObserver

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of CallbacksObserver.



4
5
6
7
# File 'lib/factory_girl/callbacks_observer.rb', line 4

def initialize(callbacks, evaluator)
  @callbacks = callbacks
  @evaluator = evaluator
end

Instance Method Details

#update(name, result_instance) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



9
10
11
12
13
# File 'lib/factory_girl/callbacks_observer.rb', line 9

def update(name, result_instance)
  callbacks_by_name(name).each do |callback|
    callback.run(result_instance, @evaluator)
  end
end