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.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(page, value, msg = nil) ⇒ InvalidPageValue
constructor
A new instance of InvalidPageValue.
Constructor Details
#initialize(page, value, msg = nil) ⇒ InvalidPageValue
Returns a new instance of InvalidPageValue.
358 359 360 361 362 |
# File 'lib/jsonapi/exceptions.rb', line 358 def initialize(page, value, msg = nil) @page = page @value = value @msg = msg.nil? ? "#{value} is not a valid value for #{page} page parameter." : msg end |
Instance Attribute Details
#page ⇒ Object
Returns the value of attribute page.
357 358 359 |
# File 'lib/jsonapi/exceptions.rb', line 357 def page @page end |
#value ⇒ Object
Returns the value of attribute value.
357 358 359 |
# File 'lib/jsonapi/exceptions.rb', line 357 def value @value end |
Instance Method Details
#errors ⇒ Object
364 365 366 367 368 369 |
# File 'lib/jsonapi/exceptions.rb', line 364 def errors [JSONAPI::Error.new(code: JSONAPI::INVALID_PAGE_VALUE, status: :bad_request, title: 'Invalid page value', detail: @msg)] end |