Exception: JSONAPI::Exceptions::PageParametersNotAllowed
- 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) ⇒ PageParametersNotAllowed
constructor
A new instance of PageParametersNotAllowed.
Constructor Details
#initialize(params) ⇒ PageParametersNotAllowed
Returns a new instance of PageParametersNotAllowed.
447 448 449 |
# File 'lib/jsonapi/exceptions.rb', line 447 def initialize(params) @params = params end |
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
446 447 448 |
# File 'lib/jsonapi/exceptions.rb', line 446 def params @params end |
Instance Method Details
#errors ⇒ Object
451 452 453 454 455 456 457 458 459 460 461 |
# File 'lib/jsonapi/exceptions.rb', line 451 def errors params.collect do |param| JSONAPI::Error.new(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 |