Exception: Core::Io::Base::JsonFormattingBehaviour::Input::ReadOnlyAttribute

Inherits:
Service::Error
  • Object
show all
Defined in:
app/api/core/io/base/json_formatting_behaviour/input.rb

Instance Method Summary collapse

Methods included from Service::Error::Behaviour

included

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 => [message])
end