Exception: Pagination::InvalidPage

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/pagination/collection.rb

Instance Method Summary collapse

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