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


3
4
5
6
# File 'app/api/core/io/base/json_formatting_behaviour/input.rb', line 3

def initialize(attribute)
  super('is read-only')
  @attribute = attribute
end

Instance Method Details

#api_error(response) ⇒ Object


8
9
10
# File 'app/api/core/io/base/json_formatting_behaviour/input.rb', line 8

def api_error(response)
  response.content_error(422, @attribute => [message])
end