Sha256: 740e295ed62652c6d6a0fca13ddda4337c66993b796d33d12e4dbd3244cdff52

Contents?: true

Size: 655 Bytes

Versions: 5

Compression:

Stored size: 655 Bytes

Contents

# frozen_string_literal: true

module Dry
  module Types
    # Hash type exposes additional APIs for working with schema hashes
    #
    # @api public
    class Hash < Nominal
      class Constructor < ::Dry::Types::Constructor
        # @api private
        def constructor_type
          ::Dry::Types::Hash::Constructor
        end

        # @return [Lax]
        #
        # @api public
        def lax
          type.lax.constructor(fn, meta: meta)
        end

        # @see Dry::Types::Array#of
        #
        # @api public
        def schema(...)
          type.schema(...).constructor(fn, meta: meta)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dry-types-1.7.2 lib/dry/types/hash/constructor.rb
dry-types-1.7.1 lib/dry/types/hash/constructor.rb
dry-types-1.7.0 lib/dry/types/hash/constructor.rb
dry-types-1.6.1 lib/dry/types/hash/constructor.rb
dry-types-1.6.0 lib/dry/types/hash/constructor.rb