Sha256: f1579ad9485c8aa0069090f6573df301cb2c7bdb9f87c550fff4f78941981072

Contents?: true

Size: 475 Bytes

Versions: 7

Compression:

Stored size: 475 Bytes

Contents

# frozen_string_literal: true

class RailsTransactionalOutbox
  module ReliableModel
    class ReliableCallbacksRegistry
      include Enumerable

      delegate :each, to: :registry

      attr_reader :registry
      private     :registry

      def initialize
        @registry = []
      end

      def <<(item)
        registry << item
      end

      def for_event_type(event_type)
        registry.select { |cb| cb.for_event?(event_type) }
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rails-transactional-outbox-1.0.0 lib/rails_transactional_outbox/reliable_model/reliable_callbacks_registry.rb
rails-transactional-outbox-0.4.0 lib/rails_transactional_outbox/reliable_model/reliable_callbacks_registry.rb
rails-transactional-outbox-0.3.1 lib/rails_transactional_outbox/reliable_model/reliable_callbacks_registry.rb
rails-transactional-outbox-0.3.0 lib/rails_transactional_outbox/reliable_model/reliable_callbacks_registry.rb
rails-transactional-outbox-0.2.1 lib/rails_transactional_outbox/reliable_model/reliable_callbacks_registry.rb
rails-transactional-outbox-0.2.0 lib/rails_transactional_outbox/reliable_model/reliable_callbacks_registry.rb
rails-transactional-outbox-0.1.0 lib/rails_transactional_outbox/reliable_model/reliable_callbacks_registry.rb