Module: WillPaginate::Mongoid::CollectionMethods
- Defined in:
- lib/rasti/paginate/mongoid.rb
Instance Attribute Summary collapse
-
#current_page ⇒ Object
readonly
Returns the value of attribute current_page.
Instance Method Summary collapse
Instance Attribute Details
#current_page ⇒ Object (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
#offset ⇒ Object
39 40 41 |
# File 'lib/rasti/paginate/mongoid.rb', line 39 def offset @page_multiplier * per_page end |
#total_entries ⇒ Object
31 32 33 |
# File 'lib/rasti/paginate/mongoid.rb', line 31 def total_entries @total_entries ||= count end |
#total_pages ⇒ Object
35 36 37 |
# File 'lib/rasti/paginate/mongoid.rb', line 35 def total_pages (total_entries / per_page.to_f).ceil end |