Exception: JSONAPI::Exceptions::PageParametersNotAllowed
- 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 = {}) ⇒ PageParametersNotAllowed
constructor
A new instance of PageParametersNotAllowed.
Methods inherited from Error
Constructor Details
#initialize(params, error_object_overrides = {}) ⇒ PageParametersNotAllowed
Returns a new instance of PageParametersNotAllowed.
532 533 534 535 |
# File 'lib/jsonapi/exceptions.rb', line 532 def initialize(params, error_object_overrides = {}) @params = params super(error_object_overrides) end |
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
530 531 532 |
# File 'lib/jsonapi/exceptions.rb', line 530 def params @params end |
Instance Method Details
#errors ⇒ Object
537 538 539 540 541 542 543 544 545 546 547 |
# File 'lib/jsonapi/exceptions.rb', line 537 def errors params.collect do |param| create_error_object(code: JSONAPI::PARAM_NOT_ALLOWED, status: :bad_request, title: I18n.translate('jsonapi-resources.exceptions.page_parameters_not_allowed.title', default: 'Page parameter not allowed'), detail: I18n.translate('jsonapi-resources.exceptions.page_parameters_not_allowed.detail', default: "#{param} is not an allowed page parameter.", param: param)) end end |