lib/jamf/api/mixins/pageable.rb
def next_collection_page
      case @collection_page
      when :first
        @collection_page = 0
      when Integer
        @collection_page += 1
      else
        # if here, we haven't initiated a paged request, or
        # all pages have already been delivered
        return []
      end

      raw = @collection_cnx.get "#{@collection_rsrc_path}?page=#{@collection_page}&page-size=#{@collection_page_size}#{@collection_sort}#{@collection_filter}"

      @collection_paged_fetched_count += raw[:results].size
      @collection_paged_total_count = raw[:totalCount]

      # did we get everything in the this page?
      # if so, clear all the paging data
      clear_collection_paging_data if @collection_paged_fetched_count >= @collection_paged_total_count

      # return the page results
      raw[:results]
    end
# Fetch the next page of a paged collection request.
#
# Returns an empty array if there's been no paged request
# or if the last one has no more pages.
#
# @return [Array<Object>] The next page of the collection for this resource
#
Fetch the next page of a paged collection request.
Returns an empty array if there's been no paged request
or if the last one has no more pages.
Fetch the next page of a paged collection request . Returns an empty array if there ' s been no paged request or if the last one has no more pages .
def next_collection_page
      case @collection_page
      when :first
        @collection_page = 0
      when Integer
        @collection_page += 1
      else
        return []
      end
      raw = @collection_cnx.get "#{@collection_rsrc_path}?page=#{@collection_page}&page-size=#{@collection_page_size}#{@collection_sort}#{@collection_filter}"
      @collection_paged_fetched_count += raw[:results].size
      @collection_paged_total_count = raw[:totalCount]
      clear_collection_paging_data if @collection_paged_fetched_count >= @collection_paged_total_count
      raw[:results]
    end
def next_collection_page case @collection_page when :first @collection_page = 0 when Integer @collection_page += 1 else return [ ] end raw = @collection_cnx . get "#{@collection_rsrc_path}?page=#{@collection_page}&page-size=#{@collection_page_size}#{@collection_sort}#{@collection_filter}" @collection_paged_fetched_count += raw [ :results ] . size @collection_paged_total_count = raw [ :totalCount ] clear_collection_paging_data if @collection_paged_fetched_count >= @collection_paged_total_count raw [ :results ] end
Fetch the next page of a paged collection request.
Fetch the next page of a paged collection request .
# if here, we haven't initiated a paged request, or # all pages have already been delivered # did we get everything in the this page? # if so, clear all the paging data # return the page results
The next page of the collection for this resource
The next page of the collection for this resource
Array<Object>