lib/chronicle/etl/extractors/extractor.rb in chronicle-etl-0.1.4 vs lib/chronicle/etl/extractors/extractor.rb in chronicle-etl-0.2.0

- old
+ new

@@ -1,21 +1,27 @@ require 'chronicle/etl' module Chronicle - module Etl + module ETL + # Abstract class representing an Extractor for an ETL job class Extractor - extend Chronicle::Etl::Catalog + extend Chronicle::ETL::Catalog - ETL_PHASE = :extractor - + # Construct a new instance of this extractor. Options are passed in from a Runner + # == Paramters: + # options:: + # Options for configuring this Extractor def initialize(options = {}) - @options = options.transform_keys!(&:to_sym) + @options = options.transform_keys!(&:to_sym) 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 end end end