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.
555 556 557 558 |
# File 'lib/jsonapi/exceptions.rb', line 555 def initialize(params, error_object_overrides = {}) @params = params super(error_object_overrides) end |
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
553 554 555 |
# File 'lib/jsonapi/exceptions.rb', line 553 def params @params end |
Instance Method Details
#errors ⇒ Object
560 561 562 563 564 565 566 567 568 569 570 |
# File 'lib/jsonapi/exceptions.rb', line 560 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 |