Sha256: ad9cf23233fb4438e5d0c373a54687680b55687611c1b22007b2869cd73ff61f

Contents?: true

Size: 752 Bytes

Versions: 23

Compression:

Stored size: 752 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Common
    module Plugins
      module HasCallbacks
        module Entities
          class TypeCollection
            attr_reader :types

            def initialize(types:)
              @types = types.map(&Entities::Type.method(:cast!))
            end

            def contain_exactly?(other_types)
              other_types = other_types.map(&Entities::Type.method(:cast!))

              Utils::Array.contain_exactly?(types, other_types)
            end

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

              return false if types != other.types

              true
            end
          end
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
convenient_service-0.19.1 lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb
convenient_service-0.19.0 lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb
convenient_service-0.18.0 lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb
convenient_service-0.17.0 lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb
convenient_service-0.16.0 lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb
convenient_service-0.15.0 lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb
convenient_service-0.14.0 lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb
convenient_service-0.13.0 lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb
convenient_service-0.12.0 lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb
convenient_service-0.11.0 lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb
convenient_service-0.10.1 lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb
convenient_service-0.10.0 lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb
convenient_service-0.9.0 lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb
convenient_service-0.8.0 lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb
convenient_service-0.7.0 lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb
convenient_service-0.6.0 lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb
convenient_service-0.5.0 lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb
convenient_service-0.4.0 lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb
convenient_service-0.3.1 lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb
convenient_service-0.3.0 lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb