class Dry::Types::Lax

@api public
Lax types rescue from type-related errors when constructors fail

def call(input, &)

Other tags:
    Api: - public

Returns:
  • (Object) -

Parameters:
  • input (Object) --
def call(input, &)
  type.call_safe(input) { |output = input| output }
end

def decorate?(response)

Other tags:
    Api: - private

Returns:
  • (Boolean) -

Parameters:
  • response (Object, Dry::Types::Constructor) --
def decorate?(response)
  super || response.is_a?(type.constructor_type)
end

def lax = self

Other tags:
    Api: - public

Returns:
  • (Lax) -
def lax = self

def to_ast(meta: true) = [:lax, type.to_ast(meta: meta)]

Other tags:
    Api: - public

Other tags:
    See: Nominal#to_ast -
def to_ast(meta: true) = [:lax, type.to_ast(meta: meta)]

def try(input, &) = type.try(input, &)

Other tags:
    Api: - public

Returns:
  • (Result, Logic::Result) -

Other tags:
    Yieldreturn: -

Other tags:
    Yieldparam: failure -

Parameters:
  • block (#call, nil) --
  • input (Object) --
def try(input, &) = type.try(input, &)