Method: Dry::Types::ConstraintError#initialize

Defined in:
lib/dry/types/errors.rb

#initialize(result, input) ⇒ ConstraintError

Returns a new instance of ConstraintError.

Parameters:

  • result (String, #to_s)
  • input (Object)


120
121
122
123
124
125
126
127
128
129
# File 'lib/dry/types/errors.rb', line 120

def initialize(result, input)
  @result = result
  @input = input

  if result.is_a?(::String)
    super(result)
  else
    super(to_s)
  end
end