Sha256: 05dff96046ccdc9b17e6a79536f5805d849452cc638cd920599d2c97c919293d

Contents?: true

Size: 450 Bytes

Versions: 19

Compression:

Stored size: 450 Bytes

Contents

module FactoryGirl
  # @api private
  class CallbacksObserver
    def initialize(callbacks, evaluator)
      @callbacks = callbacks
      @evaluator = evaluator
    end

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

    private

    def callbacks_by_name(name)
      @callbacks.select { |callback| callback.name == name }
    end
  end
end

Version data entries

19 entries across 16 versions & 8 rubygems

Version Path
ffactory_girl-4.8.2 lib/factory_girl/callbacks_observer.rb
factory_girl-4.9.0 lib/factory_girl/callbacks_observer.rb
ffactory_girl-4.8.1 lib/factory_girl/callbacks_observer.rb
factory_girl-4.8.1 lib/factory_girl/callbacks_observer.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/factory_girl-4.8.0/lib/factory_girl/callbacks_observer.rb
factory_girl-4.8.0 lib/factory_girl/callbacks_observer.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/factory_girl-4.7.0/lib/factory_girl/callbacks_observer.rb
factory_girl-4.7.0 lib/factory_girl/callbacks_observer.rb
opal-factory_girl-4.5.0.3 factory_girl/lib/factory_girl/callbacks_observer.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/factory_girl-4.5.0/lib/factory_girl/callbacks_observer.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/factory_girl-4.5.0/lib/factory_girl/callbacks_observer.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/factory_girl-4.5.0/lib/factory_girl/callbacks_observer.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/factory_girl-4.5.0/lib/factory_girl/callbacks_observer.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/factory_girl-4.4.0/lib/factory_girl/callbacks_observer.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/factory_girl-4.4.0/lib/factory_girl/callbacks_observer.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/factory_girl-4.4.0/lib/factory_girl/callbacks_observer.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/factory_girl-4.4.0/lib/factory_girl/callbacks_observer.rb
factory_girl-4.5.0 lib/factory_girl/callbacks_observer.rb
factory_girl-4.4.0 lib/factory_girl/callbacks_observer.rb