Exception: JSONAPI::Exceptions::ParametersNotAllowed
- Defined in:
- lib/jsonapi/exceptions.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
Returns the value of attribute params.
Attributes inherited from Error
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(params, error_object_overrides = {}) ⇒ ParametersNotAllowed
constructor
A new instance of ParametersNotAllowed.
Methods inherited from Error
Constructor Details
#initialize(params, error_object_overrides = {}) ⇒ ParametersNotAllowed
Returns a new instance of ParametersNotAllowed.
370 371 372 373 |
# File 'lib/jsonapi/exceptions.rb', line 370 def initialize(params, error_object_overrides = {}) @params = params super(error_object_overrides) end |
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
368 369 370 |
# File 'lib/jsonapi/exceptions.rb', line 368 def params @params end |
Instance Method Details
#errors ⇒ Object
375 376 377 378 379 380 381 382 383 384 385 |
# File 'lib/jsonapi/exceptions.rb', line 375 def errors params.collect do |param| create_error_object(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 |