Module: WillPaginate::Mongoid::CollectionMethods

Defined in:
lib/rasti/paginate/mongoid.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#current_pageObject (readonly)

Returns the value of attribute current_page.



29
30
31
# File 'lib/rasti/paginate/mongoid.rb', line 29

def current_page
  @current_page
end

Instance Method Details

#offsetObject



39
40
41
# File 'lib/rasti/paginate/mongoid.rb', line 39

def offset
  @page_multiplier * per_page
end

#total_entriesObject



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

def total_entries
  @total_entries ||= count
end

#total_pagesObject



35
36
37
# File 'lib/rasti/paginate/mongoid.rb', line 35

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