Class: Dry::Types::Hash::Permissive

Inherits:
Schema show all
Defined in:
lib/dry/types/hash/schema.rb

Overview

Permissive schema raises a MissingKeyError if the given key is missing in provided hash.

Direct Known Subclasses

Strict

Instance Attribute Summary

Attributes inherited from Schema

#member_types

Attributes inherited from Definition

#options, #primitive

Attributes included from Options

#options

Instance Method Summary collapse

Methods inherited from Schema

#call, #coerce, #initialize, #resolve, #try, #try_coerce

Methods inherited from Dry::Types::Hash

#permissive, #schema, #strict, #strict_with_defaults, #symbolized, #weak

Methods inherited from Definition

[], #call, #constrained?, #default?, #failure, #initialize, #name, #primitive?, #result, #success, #try

Methods included from Builder

#constrained, #constrained_type, #constructor, #default, #enum, #maybe, #optional, #safe, #|

Methods included from Options

#initialize, #meta, #with

Constructor Details

This class inherits a constructor from Dry::Types::Hash::Schema

Instance Method Details

#resolve_missing_value(_, key, _) ⇒ Object (private)

Parameters:

  • key (Symbol)

Raises:



118
119
120
# File 'lib/dry/types/hash/schema.rb', line 118

def resolve_missing_value(_, key, _)
  raise MissingKeyError, key
end