lib/chronicle/etl/extractors/extractor.rb in chronicle-etl-0.2.2 vs lib/chronicle/etl/extractors/extractor.rb in chronicle-etl-0.2.3
- old
+ new
@@ -10,19 +10,26 @@
# == Paramters:
# options::
# Options for configuring this Extractor
def initialize(options = {})
@options = options.transform_keys!(&:to_sym)
+ handle_continuation
end
# Entrypoint for this Extractor. Called by a Runner. Expects a series of records to be yielded
def extract
raise NotImplementedError
end
# An optional method to calculate how many records there are to extract. Used primarily for
# building the progress bar
def results_count; end
+
+ private
+
+ def handle_continuation
+ @options[:load_since] = @options[:continuation].highest_timestamp if @options[:continuation] && @options[:continuation].highest_timestamp
+ end
end
end
end
require_relative 'csv_extractor'