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.
576 577 578 579 580 |
# File 'lib/jsonapi/exceptions.rb', line 576 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.
574 575 576 |
# File 'lib/jsonapi/exceptions.rb', line 574 def page @page end |
#value ⇒ Object
Returns the value of attribute value.
574 575 576 |
# File 'lib/jsonapi/exceptions.rb', line 574 def value @value end |
Instance Method Details
#errors ⇒ Object
582 583 584 585 586 587 588 589 590 |
# File 'lib/jsonapi/exceptions.rb', line 582 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 |