Class: HubLink::Stream

Inherits:
Object
  • Object
show all
Defined in:
lib/hub_link/stream.rb

Instance Method Summary collapse

Constructor Details

#initialize(repo, start_date: nil, batch_size: 7) ⇒ Stream

Returns a new instance of Stream.



6
7
8
9
10
# File 'lib/hub_link/stream.rb', line 6

def initialize(repo, start_date: nil, batch_size: 7)
  @repo = repo
  @start_date = (start_date || date_of_first_pr).to_date
  @batch_size = batch_size
end

Instance Method Details

#in_batches(&block) ⇒ Object



12
13
14
15
16
# File 'lib/hub_link/stream.rb', line 12

def in_batches(&block)
  queries.each do |query|
    yield Batch.new(query)
  end
end