Sha256: 5d4b361e2dd294fa21dcbf17dfdba243520b933a7a438cf972f17a2c183d303d

Contents?: true

Size: 432 Bytes

Versions: 54

Compression:

Stored size: 432 Bytes

Contents

module FactoryGirl
  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

54 entries across 54 versions & 4 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/callbacks_observer.rb
classiccms-0.7.4 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/callbacks_observer.rb
classiccms-0.7.3 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/callbacks_observer.rb
classiccms-0.7.2 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/callbacks_observer.rb
classiccms-0.7.1 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/callbacks_observer.rb
classiccms-0.7.0 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/callbacks_observer.rb
classiccms-0.6.9 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/callbacks_observer.rb
classiccms-0.6.8 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/callbacks_observer.rb
classiccms-0.6.7 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/callbacks_observer.rb
classiccms-0.6.6 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/callbacks_observer.rb
classiccms-0.6.5 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/callbacks_observer.rb
classiccms-0.6.4 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/callbacks_observer.rb
classiccms-0.6.3 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/callbacks_observer.rb
classiccms-0.6.2 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/callbacks_observer.rb
classiccms-0.6.1 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/callbacks_observer.rb
classiccms-0.6.0 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/callbacks_observer.rb
classiccms-0.5.17 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/callbacks_observer.rb
classiccms-0.5.16 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/callbacks_observer.rb
classiccms-0.5.15 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/callbacks_observer.rb
classiccms-0.5.14 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/callbacks_observer.rb