Exception: Leaf::InvalidPage

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

Overview

Invalid page number error

This is an ArgumentError raised in case a page was requested that is either zero or negative number. You should decide how do deal with such errors in the controller.

Instance Method Summary collapse

Constructor Details

#initialize(page, page_num) ⇒ InvalidPage

Returns a new instance of InvalidPage.



7
8
9
# File 'lib/leaf/collection.rb', line 7

def initialize(page, page_num)
  super "#{page.inspect} given as value, which translates to '#{page_num}' as page number"
end