Exception: ViewModel::DeserializationError::UnknownAttribute
- Inherits:
-
InvalidRequest
- Object
- StandardError
- AbstractError
- AbstractErrorWithBlame
- ViewModel::DeserializationError
- InvalidRequest
- ViewModel::DeserializationError::UnknownAttribute
- Defined in:
- lib/view_model/deserialization_error.rb
Overview
A view included an unknown attribute
Instance Attribute Summary collapse
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
Attributes inherited from AbstractErrorWithBlame
Instance Method Summary collapse
- #detail ⇒ Object
-
#initialize(attribute, node) ⇒ UnknownAttribute
constructor
A new instance of UnknownAttribute.
- #meta ⇒ Object
Methods inherited from ViewModel::DeserializationError
Methods inherited from AbstractError
#aggregation?, #causes, #code, #exception, #status, #title, #to_s, #view
Constructor Details
#initialize(attribute, node) ⇒ UnknownAttribute
Returns a new instance of UnknownAttribute.
109 110 111 112 |
# File 'lib/view_model/deserialization_error.rb', line 109 def initialize(attribute, node) @attribute = attribute super([node]) end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
107 108 109 |
# File 'lib/view_model/deserialization_error.rb', line 107 def attribute @attribute end |
Instance Method Details
#detail ⇒ Object
114 115 116 |
# File 'lib/view_model/deserialization_error.rb', line 114 def detail "Unknown attribute/association #{attribute} in viewmodel '#{viewmodel_class.view_name}'" end |
#meta ⇒ Object
118 119 120 |
# File 'lib/view_model/deserialization_error.rb', line 118 def super.merge(attribute: attribute) end |