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.
525 526 527 528 |
# File 'lib/jsonapi/exceptions.rb', line 525 def initialize(params, error_object_overrides = {}) @params = params super(error_object_overrides) end |
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
523 524 525 |
# File 'lib/jsonapi/exceptions.rb', line 523 def params @params end |
Instance Method Details
#errors ⇒ Object
530 531 532 533 534 535 536 537 538 539 540 |
# File 'lib/jsonapi/exceptions.rb', line 530 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 |