Class: Chronicle::ETL::Extractor

Inherits:
Object
  • Object
show all
Extended by:
Registry::SelfRegistering
Includes:
Configurable
Defined in:
lib/chronicle/etl/extractors/extractor.rb

Overview

Abstract class representing an Extractor for an ETL job

Instance Attribute Summary

Attributes included from Registry::SelfRegistering

#connector_registration

Instance Method Summary collapse

Methods included from Registry::SelfRegistering

register_connector

Methods included from Configurable

included

Constructor Details

#initialize(options = {}) ⇒ Extractor

Construct a new instance of this extractor. Options are passed in from a Runner == Parameters: options:: Options for configuring this Extractor



22
23
24
# File 'lib/chronicle/etl/extractors/extractor.rb', line 22

def initialize(options = {})
  apply_options(options)
end

Instance Method Details

#extractObject

Entrypoint for this Extractor. Called by a Runner. Expects a series of records to be yielded

Raises:

  • (NotImplementedError)


34
35
36
# File 'lib/chronicle/etl/extractors/extractor.rb', line 34

def extract
  raise NotImplementedError
end

#prepareObject

Hook called before #extract. Useful for gathering data, initializing proxies, etc



27
# File 'lib/chronicle/etl/extractors/extractor.rb', line 27

def prepare; end

#results_countObject

An optional method to calculate how many records there are to extract. Used primarily for building the progress bar



31
# File 'lib/chronicle/etl/extractors/extractor.rb', line 31

def results_count; end