Sha256: 7237f759396e19b2420d51a815084eef09b200e6df69ba4e52f3ef0f9e7e61a9

Contents?: true

Size: 1.15 KB

Versions: 3

Compression:

Stored size: 1.15 KB

Contents

module ETL #:nodoc:
  module Control #:nodoc:
    # ETL source. Subclasses must implement the <tt>each</tt> method.
    class Source
      include Enumerable
      
      # The control object
      attr_accessor :control
      
      # The configuration Hash
      attr_accessor :configuration
      
      # The definition Hash
      attr_accessor :definition
      
      class << self
        # Convert the name to a Source class.
        # 
        # For example if name is :database then this will return a DatabaseSource class
        def class_for_name(name)
          ETL::Control.const_get("#{name.to_s.classify}Source")
        end
      end
      
      # Initialize the Source instance
      # * <tt>control</tt>: The control object
      # * <tt>configuration</tt>: The configuration hash
      # * <tt>definition</tt>: The source layout definition
      def initialize(control, configuration, definition)
        @control = control
        @configuration = configuration
        @definition = definition
      end
      
      def errors
        @errors ||= []
      end
    end
  end
end

Dir[File.dirname(__FILE__) + "/source/*.rb"].each { |file| require(file) }

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
activewarehouse-etl-0.5.0 lib/etl/control/source.rb
activewarehouse-etl-0.5.1 lib/etl/control/source.rb
activewarehouse-etl-0.5.2 lib/etl/control/source.rb