Exception: JSONAPI::Exceptions::ParametersNotAllowed
- Defined in:
- lib/jsonapi/exceptions.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
Returns the value of attribute params.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(params) ⇒ ParametersNotAllowed
constructor
A new instance of ParametersNotAllowed.
Constructor Details
#initialize(params) ⇒ ParametersNotAllowed
Returns a new instance of ParametersNotAllowed.
290 291 292 |
# File 'lib/jsonapi/exceptions.rb', line 290 def initialize(params) @params = params end |
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
289 290 291 |
# File 'lib/jsonapi/exceptions.rb', line 289 def params @params end |
Instance Method Details
#errors ⇒ Object
294 295 296 297 298 299 300 301 302 303 304 |
# File 'lib/jsonapi/exceptions.rb', line 294 def errors params.collect do |param| JSONAPI::Error.new(code: JSONAPI::PARAM_NOT_ALLOWED, status: :bad_request, title: I18n.translate('jsonapi-resources.exceptions.parameters_not_allowed.title', default: 'Param not allowed'), detail: I18n.translate('jsonapi-resources.exceptions.parameters_not_allowed.detail', default: "#{param} is not allowed.", param: param)) end end |