Module: Pragma::Decorator::Pagination::InstanceMethods

Defined in:
lib/pragma/decorator/pagination.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#current_pageInteger

Returns the current page of the collection.

Returns:

  • (Integer)

    current page number

See Also:



39
40
41
# File 'lib/pragma/decorator/pagination.rb', line 39

def current_page
  adapter.current_page
end

#next_pageInteger|NilClass

Returns the next page of the collection.

Returns:

  • (Integer|NilClass)

    next page number, if any

See Also:



48
49
50
# File 'lib/pragma/decorator/pagination.rb', line 48

def next_page
  adapter.next_page
end

#per_pageInteger

Returns the number of items per page in the collection.

Returns:

  • (Integer)

    items per page

See Also:



57
58
59
# File 'lib/pragma/decorator/pagination.rb', line 57

def per_page
  adapter.per_page
end

#previous_pageInteger|NilClass

Returns the previous page of the collection.

Returns:

  • (Integer|NilClass)

    previous page number, if any

See Also:



66
67
68
# File 'lib/pragma/decorator/pagination.rb', line 66

def previous_page
  adapter.previous_page
end

#total_entriesInteger

Returns the total number of items in the collection.

Returns:

  • (Integer)

    number of items

See Also:



75
76
77
# File 'lib/pragma/decorator/pagination.rb', line 75

def total_entries
  adapter.total_entries
end

#total_pagesInteger

Returns the total number of pages in the collection.

Returns:

  • (Integer)

    number of pages

See Also:



84
85
86
# File 'lib/pragma/decorator/pagination.rb', line 84

def total_pages
  adapter.total_pages
end