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.2.1 lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb
convenient_service-0.2.0 lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb
convenient_service-0.1.0 lib/convenient_service/common/plugins/has_callbacks/entities/type_collection.rb