Module: WillPaginate::Mongoid::CollectionMethods

Defined in:
lib/will_paginate/mongoid.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#current_pageObject (readonly)

Returns the value of attribute current_page


31
32
33
# File 'lib/will_paginate/mongoid.rb', line 31

def current_page
  @current_page
end

Instance Method Details

#offsetObject


41
42
43
# File 'lib/will_paginate/mongoid.rb', line 41

def offset
  @page_multiplier * per_page
end

#total_entriesObject


33
34
35
# File 'lib/will_paginate/mongoid.rb', line 33

def total_entries
  @total_entries ||= count
end

#total_pagesObject


37
38
39
# File 'lib/will_paginate/mongoid.rb', line 37

def total_pages
  (total_entries / per_page.to_f).ceil
end