Sha256: c1f8703a5129d76ee5bfd3834828d0e53e8c6df7ac7dddb1ccd0f950bf77d369

Contents?: true

Size: 385 Bytes

Versions: 4

Compression:

Stored size: 385 Bytes

Contents

require 'dry/types/array/member'

module Dry
  module Types
    class Array < Definition
      # @param [Type] type
      # @return [Array::Member]
      def member(type)
        member =
          case type
          when String, Class then Types[type]
          else type
          end

        Array::Member.new(primitive, options.merge(member: member))
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dry-types-0.10.3 lib/dry/types/array.rb
dry-types-0.10.2 lib/dry/types/array.rb
dry-types-0.10.1 lib/dry/types/array.rb
dry-types-0.10.0 lib/dry/types/array.rb