Exception: Pagination::InvalidPage
- Inherits:
-
ArgumentError
- Object
- ArgumentError
- Pagination::InvalidPage
- Defined in:
- lib/pagination/collection.rb
Instance Method Summary collapse
-
#initialize(page, max = 1) ⇒ InvalidPage
constructor
A new instance of InvalidPage.
Constructor Details
#initialize(page, max = 1) ⇒ InvalidPage
Returns a new instance of InvalidPage.
3 4 5 6 |
# File 'lib/pagination/collection.rb', line 3 def initialize(page, max = 1) super "#{page} must be greater than 0" if page < 1 super "#{page} must be less than #{max}" if page >= 1 end |