Module: Card::Set::Abstract::Paging::JsonFormat
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- tmpsets/set/mod008-pointer/abstract/01_paging.rb
Instance Method Summary collapse
- #add_paging_url(hash, page, status) ⇒ Object
- #page_link_path_args(page) ⇒ Object
- #paging_urls_hash ⇒ Object
Instance Method Details
#add_paging_url(hash, page, status) ⇒ Object
150 151 152 153 154 |
# File 'tmpsets/set/mod008-pointer/abstract/01_paging.rb', line 150 def add_paging_url hash, page, status return unless page && status.in?(%i[next previous]) hash[status] = path page_link_path_args(page) end |
#page_link_path_args(page) ⇒ Object
126 127 128 129 130 131 132 133 |
# File 'tmpsets/set/mod008-pointer/abstract/01_paging.rb', line 126 def page_link_path_args page { limit: limit, offset: page * limit, item: default_item_view, # hack. need standard voo handling format: :json }.merge extra_paging_path_args end |
#paging_urls_hash ⇒ Object
141 142 143 144 145 146 147 148 |
# File 'tmpsets/set/mod008-pointer/abstract/01_paging.rb', line 141 def paging_urls_hash hash = {} PagingLinks.new(total_pages, current_page) .build do |_text, page, status, | add_paging_url hash, page, status end hash end |