Sha256: 6f3db0ac31d04681394df668a6faf2681b44318369895e3560678e5b4e182cf3

Contents?: true

Size: 692 Bytes

Versions: 9

Compression:

Stored size: 692 Bytes

Contents

# frozen_string_literal: true

require 'dry/types/constructor'

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(*args)
          type.schema(*args).constructor(fn, meta: meta)
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/dry-types-1.4.0/lib/dry/types/hash/constructor.rb
dry-types-1.4.0 lib/dry/types/hash/constructor.rb
dry-types-1.3.1 lib/dry/types/hash/constructor.rb
dry-types-1.3.0 lib/dry/types/hash/constructor.rb
dry-types-1.2.2 lib/dry/types/hash/constructor.rb
dry-types-1.2.1 lib/dry/types/hash/constructor.rb
dry-types-1.2.0 lib/dry/types/hash/constructor.rb
dry-types-1.1.1 lib/dry/types/hash/constructor.rb
dry-types-1.1.0 lib/dry/types/hash/constructor.rb