Exception: AttrValidator::Errors::ValidationError
- Inherits:
-
StandardError
- Object
- StandardError
- AttrValidator::Errors::ValidationError
- Defined in:
- lib/attr_validator/errors.rb
Overview
Thrown when object has validation errors
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize(message, errors) ⇒ ValidationError
constructor
A new instance of ValidationError.
- #message ⇒ Object
- #short_message ⇒ Object
Constructor Details
#initialize(message, errors) ⇒ ValidationError
Returns a new instance of ValidationError.
6 7 8 9 |
# File 'lib/attr_validator/errors.rb', line 6 def initialize(, errors) @errors = errors super() end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
4 5 6 |
# File 'lib/attr_validator/errors.rb', line 4 def errors @errors end |
Instance Method Details
#message ⇒ Object
11 12 13 |
# File 'lib/attr_validator/errors.rb', line 11 def "#{@message}\n#{errors}" end |
#short_message ⇒ Object
15 16 17 |
# File 'lib/attr_validator/errors.rb', line 15 def 'Validation error' end |