Class: Wor::Paginate::Adapters::WillPaginateAlreadyPaginated
- Inherits:
-
Base
- Object
- Base
- Wor::Paginate::Adapters::WillPaginateAlreadyPaginated
show all
- Defined in:
- lib/wor/paginate/adapters/will_paginate_already_paginated.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Base
#adapt?, #initialize, #next_page, #previous_page
Instance Attribute Details
#page ⇒ Object
Returns the value of attribute page.
8
9
10
|
# File 'lib/wor/paginate/adapters/will_paginate_already_paginated.rb', line 8
def page
@page
end
|
Instance Method Details
#count ⇒ Object
22
23
24
|
# File 'lib/wor/paginate/adapters/will_paginate_already_paginated.rb', line 22
def count
paginated_content.to_a.size
end
|
#paginated_content ⇒ Object
17
18
19
20
|
# File 'lib/wor/paginate/adapters/will_paginate_already_paginated.rb', line 17
def paginated_content
@paginated_content ||= @content.limit(nil).offset(0)
.paginate(page: @page, per_page: @limit)
end
|
#required_methods ⇒ Object
10
11
12
13
14
15
|
# File 'lib/wor/paginate/adapters/will_paginate_already_paginated.rb', line 10
def required_methods
%i[previous_page out_of_bounds? total_entries= total_pages current_page=]
end
|
#total_count ⇒ Object
26
27
28
|
# File 'lib/wor/paginate/adapters/will_paginate_already_paginated.rb', line 26
def total_count
paginated_content.total_entries
end
|