Class: Card::Set::Abstract::Paging::PagingLinks
- Inherits:
-
Object
- Object
- Card::Set::Abstract::Paging::PagingLinks
- Defined in:
- tmpsets/set/mod008-pointer/abstract/01_paging/paging_links.rb
Overview
render paging links
Instance Method Summary collapse
-
#build(window = 2) {|text, page, status, options| ... } ⇒ Array<String>
@example: current page = 5, window = 2 |<<|1|...|3|4|[5]|6|7|...|10|>>|.
-
#initialize(total_pages, current_page) ⇒ PagingLinks
constructor
A new instance of PagingLinks.
Constructor Details
#initialize(total_pages, current_page) ⇒ PagingLinks
Returns a new instance of PagingLinks.
11 12 13 14 |
# File 'tmpsets/set/mod008-pointer/abstract/01_paging/paging_links.rb', line 11 def initialize total_pages, current_page @total = total_pages @current = current_page end |
Instance Method Details
#build(window = 2) {|text, page, status, options| ... } ⇒ Array<String>
@example: current page = 5, window = 2 |<<|1|...|3|4|[5]|6|7|...|10|>>|
24 25 26 27 |
# File 'tmpsets/set/mod008-pointer/abstract/01_paging/paging_links.rb', line 24 def build window=2, &block @render_item = block links window end |