Class: HubStore::Importer
- Inherits:
-
Object
- Object
- HubStore::Importer
- Defined in:
- lib/hub_store/importer.rb
Instance Method Summary collapse
-
#initialize(repos:, start_date: nil) ⇒ Importer
constructor
A new instance of Importer.
- #run ⇒ Object
Constructor Details
#initialize(repos:, start_date: nil) ⇒ Importer
Returns a new instance of Importer.
8 9 10 11 |
# File 'lib/hub_store/importer.rb', line 8 def initialize(repos:, start_date: nil) @repos = repos @start_date = start_date || 2.years.ago end |
Instance Method Details
#run ⇒ Object
13 14 15 16 17 18 |
# File 'lib/hub_store/importer.rb', line 13 def run stream.in_batches do |batch| import_prs(batch.pull_requests) import_reviews(batch.reviews) end end |