Exception: Dry::Types::ConstraintError
- Inherits:
-
CoercionError
- Object
- StandardError
- CoercionError
- Dry::Types::ConstraintError
- Defined in:
- lib/dry/types/errors.rb
Instance Attribute Summary collapse
- #input ⇒ Object readonly
- #result ⇒ String, #to_s readonly
Attributes inherited from CoercionError
Instance Method Summary collapse
-
#initialize(result, input) ⇒ ConstraintError
constructor
A new instance of ConstraintError.
- #message ⇒ String (also: #to_s)
Methods inherited from CoercionError
Constructor Details
permalink #initialize(result, input) ⇒ ConstraintError
Returns a new instance of ConstraintError.
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 |
Instance Attribute Details
permalink #input ⇒ Object (readonly)
116 117 118 |
# File 'lib/dry/types/errors.rb', line 116 def input @input end |
Instance Method Details
permalink #message ⇒ String Also known as: to_s
132 133 134 |
# File 'lib/dry/types/errors.rb', line 132 def "#{input.inspect} violates constraints (#{result} failed)" end |