Sha256: 1fc45a1c27d1241460d43faec217243ee1822fcab7df4b690a79a4f0c4db4c26

Contents?: true

Size: 749 Bytes

Versions: 20

Compression:

Stored size: 749 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Common
    module Plugins
      module HasCallbacks
        module Entities
          class CallbackCollection
            include Support::Delegate

            attr_reader :callbacks

            delegate :each, :include?, :<<, to: :callbacks

            def initialize
              @callbacks = []
            end

            def for(types)
              callbacks.select { |callback| callback.types.contain_exactly?(types) }
            end

            def ==(other)
              return unless other.instance_of?(self.class)

              return false if callbacks != other.callbacks

              true
            end
          end
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
convenient_service-0.17.0 lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb
convenient_service-0.16.0 lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb
convenient_service-0.15.0 lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb
convenient_service-0.14.0 lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb
convenient_service-0.13.0 lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb
convenient_service-0.12.0 lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb
convenient_service-0.11.0 lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb
convenient_service-0.10.1 lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb
convenient_service-0.10.0 lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb
convenient_service-0.9.0 lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb
convenient_service-0.8.0 lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb
convenient_service-0.7.0 lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb
convenient_service-0.6.0 lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb
convenient_service-0.5.0 lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb
convenient_service-0.4.0 lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb
convenient_service-0.3.1 lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb
convenient_service-0.3.0 lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb
convenient_service-0.2.1 lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb
convenient_service-0.2.0 lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb
convenient_service-0.1.0 lib/convenient_service/common/plugins/has_callbacks/entities/callback_collection.rb