Sha256: 56c150c25e181128fd7a3262871cebe5f28b1020f8f20cdb5ce451e5ccb9fa1e
Contents?: true
Size: 883 Bytes
Versions: 1
Compression:
Stored size: 883 Bytes
Contents
require "hub_link" require "hub_link/insert" module HubLink class Importer def self.run(*args) new(*args).run end def initialize(repo:, since:, resources:) @repo = repo.to_s @since = since @resources = resources end def run stream.in_batches do |batch| resources.each do |source, target| import batch.fetch(source), to: target end end end private attr_reader :repo, :since, :resources def import(records, to:) logger.info(START) { "Storing #{records.size} record(s) " } records.each do |row| Insert.new(row: row, target: to).run end logger.info(FINISH) { "Total: #{to.count}" } end def stream @_stream ||= Stream.new(repo, since: since) end def logger HubLink.logger end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
hub_link-0.13.0 | lib/hub_link/importer.rb |