Class: Cuprum::Collections::Errors::ExtraAttributes
- Inherits:
-
Error
- Object
- Error
- Cuprum::Collections::Errors::ExtraAttributes
- Defined in:
- lib/cuprum/collections/errors/extra_attributes.rb
Overview
Error returned when assigning invalid attributes to an entity.
Constant Summary collapse
- TYPE =
Short string used to identify the type of error.
'cuprum.collections.errors.extra_attributes'
Instance Attribute Summary collapse
-
#entity_class ⇒ Class
readonly
The class of the assigned entity.
-
#extra_attributes ⇒ Array<String>
readonly
The names of the extra attributes that were assigned to the entity.
-
#valid_attributes ⇒ Array<String>
readonly
The names of valid attributes for the entity.
Instance Method Summary collapse
-
#initialize(entity_class:, extra_attributes:, valid_attributes:) ⇒ ExtraAttributes
constructor
A new instance of ExtraAttributes.
Constructor Details
#initialize(entity_class:, extra_attributes:, valid_attributes:) ⇒ ExtraAttributes
Returns a new instance of ExtraAttributes.
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/cuprum/collections/errors/extra_attributes.rb', line 18 def initialize(entity_class:, extra_attributes:, valid_attributes:) @entity_class = entity_class @extra_attributes = extra_attributes @valid_attributes = valid_attributes super( entity_class: entity_class, extra_attributes: extra_attributes, message: , valid_attributes: valid_attributes ) end |
Instance Attribute Details
#entity_class ⇒ Class (readonly)
Returns the class of the assigned entity.
32 33 34 |
# File 'lib/cuprum/collections/errors/extra_attributes.rb', line 32 def entity_class @entity_class end |
#extra_attributes ⇒ Array<String> (readonly)
Returns The names of the extra attributes that were assigned to the entity.
36 37 38 |
# File 'lib/cuprum/collections/errors/extra_attributes.rb', line 36 def extra_attributes @extra_attributes end |
#valid_attributes ⇒ Array<String> (readonly)
Returns The names of valid attributes for the entity.
39 40 41 |
# File 'lib/cuprum/collections/errors/extra_attributes.rb', line 39 def valid_attributes @valid_attributes end |