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.
255 256 257 258 |
# File 'lib/view_model/deserialization_error.rb', line 255 def initialize(attribute, node) @attribute = attribute super([node]) end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
253 254 255 |
# File 'lib/view_model/deserialization_error.rb', line 253 def attribute @attribute end |
Instance Method Details
#detail ⇒ Object
260 261 262 |
# File 'lib/view_model/deserialization_error.rb', line 260 def detail "Cannot edit read only attribute '#{attribute}'" end |
#meta ⇒ Object
264 265 266 |
# File 'lib/view_model/deserialization_error.rb', line 264 def super.merge(attribute: attribute) end |