Sha256: a49f58e7f51257406b81cd7b42686a6d4a7d52f2261f169b3a43e4f0e603b63d

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

module Chronicle
  module ETL
    # Abstract class representing an Transformer for an ETL job
    class Transformer
      extend Chronicle::ETL::Catalog

      # Construct a new instance of this transformer. Options are passed in from a Runner
      # == Paramters:
      # options::
      #   Options for configuring this Transformer
      def initialize(options = {}, data)
        @options = options
        @data = data
        @record = Chronicle::ETL::Models::Activity.new
      end

      # @abstract Subclass is expected to implement #transform
      # @!method transform
      #   The main entrypoint for transforming a record. Called by a Runner on each extracted record

      # The domain or provider-specific id of the record this transformer is working on.
      # Used for building a cursor so an extractor doesn't have to start from the beginning of a
      # data source from the beginning.
      def id; end

      # The domain or provider-specific timestamp of the record this transformer is working on.
      # Used for building a cursor so an extractor doesn't have to start from the beginning of a
      # data source from the beginning.
      def timestamp; end
    end
  end
end

require_relative 'null_transformer'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
chronicle-etl-0.2.4 lib/chronicle/etl/transformers/transformer.rb