Sha256: f2dd879c85d1d1bf038fe039e42576ab1c639376fd9ebbae6a13cc8a7c319fa3

Contents?: true

Size: 415 Bytes

Versions: 3

Compression:

Stored size: 415 Bytes

Contents

require "hub_link/batch"

module HubLink
  class Stream
    def initialize(repo, since: nil)
      @repo = repo
      @since = since&.to_date
    end

    def in_batches(&block)
      page = 1
      loop do
        batch = Batch.new(repo: repo, since: since, page: page)
        break if batch.empty?
        yield batch
        page += 1
      end
    end

    private

      attr_accessor :repo, :since
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hub_link-0.19.0 lib/hub_link/stream.rb
hub_link-0.18.0 lib/hub_link/stream.rb
hub_link-0.15.0 lib/hub_link/stream.rb