Class: Cuprum::Collections::Errors::FailedValidation
- Inherits:
-
Error
- Object
- Error
- Cuprum::Collections::Errors::FailedValidation
- Defined in:
- lib/cuprum/collections/errors/failed_validation.rb
Overview
Error returned when a collection item fails validation.
Constant Summary collapse
- TYPE =
Short string used to identify the type of error.
'cuprum.collections.errors.failed_validation'
Instance Attribute Summary collapse
-
#entity_class ⇒ Class
readonly
The class of the assigned entity.
-
#errors ⇒ Stannum::Errors
readonly
The errors generated when validating the entity.
Instance Method Summary collapse
-
#initialize(entity_class:, errors:) ⇒ FailedValidation
constructor
A new instance of FailedValidation.
Constructor Details
#initialize(entity_class:, errors:) ⇒ FailedValidation
Returns a new instance of FailedValidation.
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/cuprum/collections/errors/failed_validation.rb', line 16 def initialize(entity_class:, errors:) @entity_class = entity_class @errors = errors super( entity_class: entity_class, errors: errors, message: ) end |
Instance Attribute Details
#entity_class ⇒ Class (readonly)
Returns the class of the assigned entity.
28 29 30 |
# File 'lib/cuprum/collections/errors/failed_validation.rb', line 28 def entity_class @entity_class end |
#errors ⇒ Stannum::Errors (readonly)
Returns The errors generated when validating the entity.
31 32 33 |
# File 'lib/cuprum/collections/errors/failed_validation.rb', line 31 def errors @errors end |