Exception: Dry::Types::SchemaError
- Inherits:
-
CoercionError
- Object
- StandardError
- CoercionError
- Dry::Types::SchemaError
- Defined in:
- lib/dry/types/errors.rb
Instance Attribute Summary collapse
- #key ⇒ String, Symbol readonly
- #value ⇒ Object readonly
Attributes inherited from CoercionError
Instance Method Summary collapse
-
#initialize(key, value, result) ⇒ SchemaError
constructor
A new instance of SchemaError.
Methods inherited from CoercionError
Constructor Details
#initialize(key, value, result) ⇒ SchemaError
Returns a new instance of SchemaError.
75 76 77 78 79 80 81 82 |
# File 'lib/dry/types/errors.rb', line 75 def initialize(key, value, result) @key = key @value = value super( "#{value.inspect} (#{value.class}) has invalid type " \ "for :#{key} violates constraints (#{result} failed)" ) end |
Instance Attribute Details
#key ⇒ String, Symbol (readonly)
67 68 69 |
# File 'lib/dry/types/errors.rb', line 67 def key @key end |
#value ⇒ Object (readonly)
70 71 72 |
# File 'lib/dry/types/errors.rb', line 70 def value @value end |