Sha256: 0ea08a071408d53a70e00e61f83dc1e65eb11962bed4ff9e301a8643cf6e4070
Contents?: true
Size: 714 Bytes
Versions: 9
Compression:
Stored size: 714 Bytes
Contents
# frozen_string_literal: true module RatingChgkV2 module Concerns module Paginated def next_page! page_num = current_page + 1 params = endpoint.params.merge({page: page_num}) endpoint.reinitialize new_params: params setup endpoint.do_get, endpoint self end def prev_page! return if current_page <= 1 page_num = current_page - 1 params = endpoint.params.merge({page: page_num}) endpoint.reinitialize new_params: params setup endpoint.do_get, endpoint self end private def current_page endpoint.params[:page] || 1 end end end end
Version data entries
9 entries across 9 versions & 1 rubygems