Sha256: 85a3c90db01eef8051570c30457165b7e45fd45ed37bbd078e0960ee3432e5cd

Contents?: true

Size: 449 Bytes

Versions: 33

Compression:

Stored size: 449 Bytes

Contents

module FactoryBot
  # @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

33 entries across 32 versions & 3 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/factory_bot-6.5.0/lib/factory_bot/callbacks_observer.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/factory_bot-6.5.0/lib/factory_bot/callbacks_observer.rb
factory_bot-6.5.0 lib/factory_bot/callbacks_observer.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/factory_bot-6.4.6/lib/factory_bot/callbacks_observer.rb
factory_bot-6.4.6 lib/factory_bot/callbacks_observer.rb
factory_bot-6.4.5 lib/factory_bot/callbacks_observer.rb
factory_bot-6.4.4 lib/factory_bot/callbacks_observer.rb
factory_bot-6.4.3 lib/factory_bot/callbacks_observer.rb
factory_bot-6.4.2 lib/factory_bot/callbacks_observer.rb
factory_bot-6.4.1 lib/factory_bot/callbacks_observer.rb
factory_bot-6.4.0 lib/factory_bot/callbacks_observer.rb
factory_bot-6.3.0 lib/factory_bot/callbacks_observer.rb
factory_bot-6.2.1 lib/factory_bot/callbacks_observer.rb
factory_bot-6.2.0 lib/factory_bot/callbacks_observer.rb
factory_bot-6.1.0 lib/factory_bot/callbacks_observer.rb
factory_bot-6.0.2 lib/factory_bot/callbacks_observer.rb
factory_bot-6.0.1 lib/factory_bot/callbacks_observer.rb
factory_bot-6.0.0 lib/factory_bot/callbacks_observer.rb
factory_bot-5.2.0 lib/factory_bot/callbacks_observer.rb
factory_bot-5.1.2 lib/factory_bot/callbacks_observer.rb