Class: Confium::ValidationError
- Inherits:
-
Error
- Object
- Error
- Confium::ValidationError
- Defined in:
- lib/confium/errors/validation_error.rb
Overview
Raised when input is well-formed but semantically invalid (wrong size, out-of-range value, etc.).
Instance Attribute Summary collapse
-
#actual ⇒ Object
readonly
Returns the value of attribute actual.
-
#expected ⇒ Object
readonly
Returns the value of attribute expected.
-
#param ⇒ Object
readonly
Returns the value of attribute param.
Instance Method Summary collapse
-
#initialize(message = nil, details_hash = nil, **kwargs) ⇒ ValidationError
constructor
A new instance of ValidationError.
Constructor Details
#initialize(message = nil, details_hash = nil, **kwargs) ⇒ ValidationError
Returns a new instance of ValidationError.
8 9 10 11 12 13 14 |
# File 'lib/confium/errors/validation_error.rb', line 8 def initialize( = nil, details_hash = nil, **kwargs) , kwargs = Confium::Errors::Coerce.args(, details_hash, kwargs) @param = kwargs.delete(:param) @expected = kwargs.delete(:expected) @actual = kwargs.delete(:actual) super(, details: { param: @param, expected: @expected, actual: @actual, **kwargs }) end |
Instance Attribute Details
#actual ⇒ Object (readonly)
Returns the value of attribute actual.
6 7 8 |
# File 'lib/confium/errors/validation_error.rb', line 6 def actual @actual end |
#expected ⇒ Object (readonly)
Returns the value of attribute expected.
6 7 8 |
# File 'lib/confium/errors/validation_error.rb', line 6 def expected @expected end |
#param ⇒ Object (readonly)
Returns the value of attribute param.
6 7 8 |
# File 'lib/confium/errors/validation_error.rb', line 6 def param @param end |