Module: Pagination
- Extended by:
- Pagination
- Included in:
- Pagination
- Defined in:
- lib/pagination.rb,
lib/pagination/helpers.rb,
lib/pagination/template.rb,
lib/pagination/collection.rb,
lib/pagination/adapters/ohm.rb
Defined Under Namespace
Modules: Helpers
Classes: Collection, OhmAdapter, Template
Instance Method Summary
collapse
Instance Method Details
#adapter(adapter = nil) ⇒ Object
18
19
20
21
22
23
24
|
# File 'lib/pagination.rb', line 18
def adapter(adapter = nil)
if adapter
@adapter = adapter
else
const_get(@adapter) if @adapter
end
end
|
#paginate(collection, options = {}) ⇒ Object
9
10
11
|
# File 'lib/pagination.rb', line 9
def paginate(collection, options = {})
adapter.new(collection, options)
end
|
#per_page(per_page = nil) ⇒ Object
13
14
15
16
|
# File 'lib/pagination.rb', line 13
def per_page(per_page = nil)
@per_page = per_page if per_page
@per_page
end
|