Module: WillPaginate::SequelMethods
Overview
Sequel already supports pagination; we only need to make the resulting dataset look a bit more like WillPaginate::Collection
Instance Method Summary
collapse
#next_page, #previous_page
Instance Method Details
#offset ⇒ Object
Current offset of the paginated collection
33
34
35
|
# File 'lib/will_paginate/sequel.rb', line 33
def offset
(current_page - 1) * per_page
end
|
#out_of_bounds? ⇒ Boolean
28
29
30
|
# File 'lib/will_paginate/sequel.rb', line 28
def out_of_bounds?
current_page > total_pages
end
|
#per_page ⇒ Object
15
16
17
|
# File 'lib/will_paginate/sequel.rb', line 15
def per_page
page_size
end
|
#size ⇒ Object
Also known as:
length
19
20
21
|
# File 'lib/will_paginate/sequel.rb', line 19
def size
current_page_record_count
end
|
#total_entries ⇒ Object
24
25
26
|
# File 'lib/will_paginate/sequel.rb', line 24
def total_entries
end
|
#total_pages ⇒ Object
11
12
13
|
# File 'lib/will_paginate/sequel.rb', line 11
def total_pages
page_count
end
|