class Chronicle::ETL::JobDefinition

Constants

SKELETON_DEFINITION

Attributes

definition[RW]

Public Class Methods

new() click to toggle source
# File lib/chronicle/etl/job_definition.rb, line 23
def initialize()
  @definition = SKELETON_DEFINITION
end

Public Instance Methods

add_config(config = {}) click to toggle source

Add config hash to this definition

# File lib/chronicle/etl/job_definition.rb, line 28
def add_config(config = {})
  @definition = config.deep_merge(@definition)
  load_credentials
  validate
end

Private Instance Methods

load_credentials() click to toggle source
# File lib/chronicle/etl/job_definition.rb, line 36
def load_credentials
  Chronicle::ETL::Catalog::PHASES.each do |phase|
    credentials_name = @definition[phase][:options][:credentials]
    if credentials_name
      credentials = Chronicle::ETL::Config.load_credentials(credentials_name)
      @definition[phase][:options].deep_merge(credentials)
    end
  end
end
validate() click to toggle source
# File lib/chronicle/etl/job_definition.rb, line 46
def validate
  return true   # TODO
end