Sha256: 0bd57720a22a79888681408411b5ad02bf3993bb45481502f62e6662ed9e108f
Contents?: true
Size: 547 Bytes
Versions: 6
Compression:
Stored size: 547 Bytes
Contents
# frozen_string_literal: true module Shipit class OctokitIterator include Enumerable def initialize(relation = nil, github_api: nil) if relation @response = relation.get(per_page: 100) else data = yield github_api @response = github_api.last_response if data.present? end end def each(&block) response = @response loop do response.data.each(&block) return unless response.rels[:next] response = response.rels[:next].get end end end end
Version data entries
6 entries across 6 versions & 1 rubygems