Class: Dry::Types::Constructor::Function::Wrapper Private

Inherits:
Dry::Types::Constructor::Function show all
Defined in:
lib/dry/types/constructor/function.rb

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

Instance Attribute Summary

Attributes inherited from Dry::Types::Constructor::Function

#fn

Instance Method Summary collapse

Methods inherited from Dry::Types::Constructor::Function

#<<, #>>, [], #initialize, #to_ast, #wrapper?, yields_block?

Constructor Details

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

Instance Method Details

#arityObject

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.



128
# File 'lib/dry/types/constructor/function.rb', line 128

def arity = 2

#call(input, type) ⇒ Object Also known as: []

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.

Returns:

  • (Object)


121
122
123
124
125
# File 'lib/dry/types/constructor/function.rb', line 121

def call(input, type, &)
  @fn.(input, type, &)
rescue ::NoMethodError, ::TypeError, ::ArgumentError => e
  CoercionError.handle(e, &)
end