module ETL #:nodoc:
module Control #:nodoc:
# ETL source. Subclasses must implement the each 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
# * control: The control object
# * configuration: The configuration hash
# * definition: 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) }