lib/chronicle/etl/extractors/extractor.rb in chronicle-etl-0.3.0 vs lib/chronicle/etl/extractors/extractor.rb in chronicle-etl-0.3.1
- old
+ new
@@ -14,17 +14,20 @@
@options = options.transform_keys!(&:to_sym)
sanitize_options
handle_continuation
end
- # Entrypoint for this Extractor. Called by a Runner. Expects a series of records to be yielded
- def extract
- raise NotImplementedError
- end
+ # Hook called before #extract. Useful for gathering data, initailizing proxies, etc
+ def prepare; end
# An optional method to calculate how many records there are to extract. Used primarily for
# building the progress bar
def results_count; end
+
+ # Entrypoint for this Extractor. Called by a Runner. Expects a series of records to be yielded
+ def extract
+ raise NotImplementedError
+ end
private
def sanitize_options
@options[:load_since] = Time.parse(@options[:load_since]) if @options[:load_since] && @options[:load_since].is_a?(String)