Exception: JSONAPI::Exceptions::InvalidPageValue
- Defined in:
- lib/jsonapi/exceptions.rb
Instance Attribute Summary collapse
-
#page ⇒ Object
Returns the value of attribute page.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Error
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(page, value, error_object_overrides = {}) ⇒ InvalidPageValue
constructor
A new instance of InvalidPageValue.
Methods inherited from Error
Constructor Details
#initialize(page, value, error_object_overrides = {}) ⇒ InvalidPageValue
Returns a new instance of InvalidPageValue.
553 554 555 556 557 |
# File 'lib/jsonapi/exceptions.rb', line 553 def initialize(page, value, error_object_overrides = {}) @page = page @value = value super(error_object_overrides) end |
Instance Attribute Details
#page ⇒ Object
Returns the value of attribute page.
551 552 553 |
# File 'lib/jsonapi/exceptions.rb', line 551 def page @page end |
#value ⇒ Object
Returns the value of attribute value.
551 552 553 |
# File 'lib/jsonapi/exceptions.rb', line 551 def value @value end |
Instance Method Details
#errors ⇒ Object
559 560 561 562 563 564 565 566 567 |
# File 'lib/jsonapi/exceptions.rb', line 559 def errors [create_error_object(code: JSONAPI::INVALID_PAGE_VALUE, status: :bad_request, title: I18n.translate('jsonapi-resources.exceptions.invalid_page_value.title', default: 'Invalid page value'), detail: I18n.translate('jsonapi-resources.exceptions.invalid_page_value.detail', default: "#{value} is not a valid value for #{page} page parameter.", value: value, page: page))] end |