Exception: ViewModel::DeserializationError::ReadOnlyAttribute
- Inherits:
-
ViewModel::DeserializationError
- Object
- StandardError
- AbstractError
- AbstractErrorWithBlame
- ViewModel::DeserializationError
- ViewModel::DeserializationError::ReadOnlyAttribute
- Defined in:
- lib/view_model/deserialization_error.rb
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) ⇒ ReadOnlyAttribute
constructor
A new instance of ReadOnlyAttribute.
- #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) ⇒ ReadOnlyAttribute
Returns a new instance of ReadOnlyAttribute.
272 273 274 275 |
# File 'lib/view_model/deserialization_error.rb', line 272 def initialize(attribute, node) @attribute = attribute super([node]) end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
270 271 272 |
# File 'lib/view_model/deserialization_error.rb', line 270 def attribute @attribute end |
Instance Method Details
#detail ⇒ Object
277 278 279 |
# File 'lib/view_model/deserialization_error.rb', line 277 def detail "Cannot edit read only attribute '#{attribute}'" end |
#meta ⇒ Object
281 282 283 |
# File 'lib/view_model/deserialization_error.rb', line 281 def super.merge(attribute: attribute) end |