Module: Card::Set::Abstract::Paging::Format
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- tmpsets/set/mod008-pointer/abstract/01_paging.rb
Instance Method Summary collapse
- #count_with_params ⇒ Object
- #current_page ⇒ Object
-
#extra_paging_path_args ⇒ Object
for override.
- #limit ⇒ Object
- #offset ⇒ Object
- #search_with_params ⇒ Object
- #total_pages ⇒ Object
Instance Method Details
#count_with_params ⇒ Object
23 24 25 |
# File 'tmpsets/set/mod008-pointer/abstract/01_paging.rb', line 23 def count_with_params card.item_names.count end |
#current_page ⇒ Object
32 33 34 |
# File 'tmpsets/set/mod008-pointer/abstract/01_paging.rb', line 32 def current_page (offset / limit).to_i end |
#extra_paging_path_args ⇒ Object
for override
37 38 39 |
# File 'tmpsets/set/mod008-pointer/abstract/01_paging.rb', line 37 def extra_paging_path_args {} end |
#limit ⇒ Object
11 12 13 |
# File 'tmpsets/set/mod008-pointer/abstract/01_paging.rb', line 11 def limit limit_param end |
#offset ⇒ Object
15 16 17 |
# File 'tmpsets/set/mod008-pointer/abstract/01_paging.rb', line 15 def offset offset_param end |
#search_with_params ⇒ Object
19 20 21 |
# File 'tmpsets/set/mod008-pointer/abstract/01_paging.rb', line 19 def search_with_params card.item_names end |
#total_pages ⇒ Object
27 28 29 30 |
# File 'tmpsets/set/mod008-pointer/abstract/01_paging.rb', line 27 def total_pages return 1 if limit.zero? ((count_with_params - 1) / limit).to_i end |