module Roar::Contrib::Decorator::PageRepresenter

Public Instance Methods

current_page() click to toggle source
# File lib/roar/contrib/decorator/page_representer.rb, line 19
def current_page
  represented.current_page
end
next_page() click to toggle source
# File lib/roar/contrib/decorator/page_representer.rb, line 23
def next_page
  represented.next_page
end
page_url(args) click to toggle source
# File lib/roar/contrib/decorator/page_representer.rb, line 10
def page_url(args)
  raise NotImplementedError
end
per_page() click to toggle source

WillPaginate uses per_page while Kaminari uses limit_value

# File lib/roar/contrib/decorator/page_representer.rb, line 28
def per_page
  per_page_method = represented.respond_to?(:per_page) ?
    :per_page : :limit_value

  represented.send per_page_method
end
previous_page() click to toggle source

WillPaginate uses previous_page while Kaminari uses prev_page

# File lib/roar/contrib/decorator/page_representer.rb, line 36
def previous_page
  previous_page_method = represented.respond_to?(:previous_page) ?
    :previous_page : :prev_page

  represented.send previous_page_method
end
total_entries() click to toggle source

WillPaginate uses total_entries while Kaminari uses total_count

# File lib/roar/contrib/decorator/page_representer.rb, line 44
def total_entries
  total_entries_method = represented.respond_to?(:total_entries) ?
    :total_entries : :total_count

  represented.send total_entries_method
end