Module: WillPaginate::Mongoid::CollectionMethods
- Defined in:
- lib/will_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.
31 32 33 |
# File 'lib/will_paginate/mongoid.rb', line 31 def current_page @current_page end |
Instance Method Details
#offset ⇒ Object
41 42 43 |
# File 'lib/will_paginate/mongoid.rb', line 41 def offset @page_multiplier * per_page end |
#total_entries ⇒ Object
33 34 35 |
# File 'lib/will_paginate/mongoid.rb', line 33 def total_entries @total_entries ||= count end |
#total_pages ⇒ Object
37 38 39 |
# File 'lib/will_paginate/mongoid.rb', line 37 def total_pages (total_entries / per_page.to_f).ceil end |