Module: WillPaginate::SequelMethods
- Includes:
- CollectionMethods
- Defined in:
- lib/will_paginate/sequel.rb
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
- (Object) offset
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
|
- (Boolean) out_of_bounds?
28
29
30
|
# File 'lib/will_paginate/sequel.rb', line 28
def out_of_bounds?
current_page > total_pages
end
|
- (Object) per_page
15
16
17
|
# File 'lib/will_paginate/sequel.rb', line 15
def per_page
page_size
end
|
- (Object) size
Also known as:
length
19
20
21
|
# File 'lib/will_paginate/sequel.rb', line 19
def size
current_page_record_count
end
|
- (Object) total_entries
24
25
26
|
# File 'lib/will_paginate/sequel.rb', line 24
def total_entries
end
|
- (Object) total_pages
11
12
13
|
# File 'lib/will_paginate/sequel.rb', line 11
def total_pages
page_count
end
|