Class: Pagination::OhmAdapter
- Inherits:
-
Collection
- Object
- Collection
- Pagination::OhmAdapter
- Defined in:
- lib/pagination/adapters/ohm.rb
Constant Summary
Constants inherited from Collection
Instance Attribute Summary
Attributes inherited from Collection
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize(dataset, options = {}) ⇒ OhmAdapter
constructor
A new instance of OhmAdapter.
Methods inherited from Collection
#current?, #displayed_pages, #each, #next_page, #prev_page, #render?, #total_pages
Constructor Details
#initialize(dataset, options = {}) ⇒ OhmAdapter
Returns a new instance of OhmAdapter.
3 4 5 6 7 8 9 10 11 |
# File 'lib/pagination/adapters/ohm.rb', line 3 def initialize(dataset, = {}) super @dataset = dataset @total = dataset.size @sort_by = [:sort_by] @order = [:order] @start = (page - 1) * per_page end |
Instance Method Details
#empty? ⇒ Boolean
13 14 15 |
# File 'lib/pagination/adapters/ohm.rb', line 13 def empty? @total.zero? end |