class Libis::Ingester::Job

Public Class Methods

from_hash(hash) click to toggle source
# File lib/libis/ingester/job.rb, line 25
def self.from_hash(hash)
  hash['log_level'] ||= 'DEBUG'
  # noinspection RubyResolve
  self.create_from_hash(hash, [:name]) do |item, cfg|
    item.workflow = Libis::Ingester::Workflow.from_hash(name: cfg.delete('workflow'))
    item.organization = Libis::Ingester::Organization.from_hash(name: cfg.delete('organization'))
    item.ingest_model = Libis::Ingester::IngestModel.from_hash(name: cfg.delete('ingest_model'))
  end
end

Private Instance Methods

create_run_object() click to toggle source

noinspection RubyResolve

Calls superclass method
# File lib/libis/ingester/job.rb, line 49
def create_run_object
  self.run_object = 'Libis::Ingester::Run'
  super
end
execute(opts = {}) click to toggle source
Calls superclass method
# File lib/libis/ingester/job.rb, line 54
def execute(opts = {})
  opts['run_config'] ||= {}
  opts['run_config']['error_to'] ||= self.error_to if self.error_to
  opts['run_config']['success_to'] ||= self.success_to if self.success_to
  super opts
end
ingest_dir() click to toggle source
# File lib/libis/ingester/job.rb, line 44
def ingest_dir
  self.organization.ingest_dir
end
material_flow() click to toggle source
# File lib/libis/ingester/job.rb, line 40
def material_flow
  self.organization.material_flow[self.read_attribute(:material_flow) || 'default']
end
producer() click to toggle source

noinspection RubyResolve

# File lib/libis/ingester/job.rb, line 36
def producer
  self.organization.producer
end