Class: Dry::Types::Hash::Permissive
- Inherits:
-
Schema
- Object
- Definition
- Dry::Types::Hash
- Schema
- Dry::Types::Hash::Permissive
- 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
Instance Attribute Summary
Attributes inherited from Schema
Attributes inherited from Definition
Attributes included from Options
Instance Method Summary collapse
- #hash_type ⇒ Object private
- #resolve_missing_value(_, key, _) ⇒ Object private
Methods inherited from Schema
#call, #coerce, #initialize, #resolve, #to_ast, #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, #optional?, #primitive?, #result, #success, #to_ast, #try
Methods included from Builder
#constrained, #constrained_type, #constructor, #default, #enum, #maybe, #optional, #safe, #|
Methods included from Options
#initialize, #meta, #pristine, #with
Constructor Details
This class inherits a constructor from Dry::Types::Hash::Schema
Instance Method Details
#hash_type ⇒ Object (private)
132 133 134 |
# File 'lib/dry/types/hash/schema.rb', line 132 def hash_type :permissive end |
#resolve_missing_value(_, key, _) ⇒ Object (private)
138 139 140 |
# File 'lib/dry/types/hash/schema.rb', line 138 def resolve_missing_value(_, key, _) raise MissingKeyError, key end |