Exception: Core::Io::Base::JsonFormattingBehaviour::Input::ReadOnlyAttribute
- Inherits:
-
Service::Error
- Object
- StandardError
- Service::Error
- Core::Io::Base::JsonFormattingBehaviour::Input::ReadOnlyAttribute
- Defined in:
- app/api/core/io/base/json_formatting_behaviour/input.rb
Instance Method Summary collapse
- #api_error(response) ⇒ Object
-
#initialize(attribute) ⇒ ReadOnlyAttribute
constructor
A new instance of ReadOnlyAttribute.
Methods included from Service::Error::Behaviour
Constructor Details
#initialize(attribute) ⇒ ReadOnlyAttribute
Returns a new instance of ReadOnlyAttribute.
5 6 7 8 |
# File 'app/api/core/io/base/json_formatting_behaviour/input.rb', line 5 def initialize(attribute) super('is read-only') @attribute = attribute end |
Instance Method Details
#api_error(response) ⇒ Object
10 11 12 |
# File 'app/api/core/io/base/json_formatting_behaviour/input.rb', line 10 def api_error(response) response.content_error(422, @attribute => []) end |