Class: Dry::Types::Hash::Constructor

Inherits:
Constructor show all
Defined in:
lib/dry/types/hash/constructor.rb

Constant Summary

Constants inherited from Nominal

Nominal::ALWAYS

Instance Attribute Summary

Attributes inherited from Constructor

#fn, #type

Attributes inherited from Nominal

#primitive

Attributes included from Options

#options

Instance Method Summary collapse

Methods inherited from Constructor

[], #call_safe, #call_unsafe, #constrained_type, #constructor, #initialize, new, #prepend, #to_ast, #to_proc, #try, wrapper_type

Methods inherited from Nominal

[], #call_safe, #call_unsafe, #coerce, #constrained?, #default?, #failure, #initialize, #name, #optional?, #primitive?, #success, #to_ast, #to_proc, #try, #try_coerce

Methods included from Printable

#to_s

Methods included from Builder

#&, #>, #constrained, #constrained_type, #constructor, #default, #enum, #fallback, #maybe, #optional, #|

Methods included from Meta

#initialize, #meta, #pristine, #with

Methods included from Options

#initialize, #with

Methods included from Type

#call, #valid?

Constructor Details

This class inherits a constructor from Dry::Types::Constructor

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Dry::Types::Constructor

Instance Method Details

#constructor_typeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11
12
13
# File 'lib/dry/types/hash/constructor.rb', line 11

def constructor_type
  ::Dry::Types::Hash::Constructor
end

#laxLax

Returns:



18
19
20
# File 'lib/dry/types/hash/constructor.rb', line 18

def lax
  type.lax.constructor(fn, meta: meta)
end

#schemaObject

See Also:



25
26
27
# File 'lib/dry/types/hash/constructor.rb', line 25

def schema(...)
  type.schema(...).constructor(fn, meta: meta)
end