Class: CDMDEXER::ETLBySetSpecs

Inherits:
Object
  • Object
show all
Defined in:
lib/cdmdexer/etl_by_set_specs.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(set_specs: [:missing_setspec], etl_config: :missing_etl_config, etl_worker_klass: ETLWorker) ⇒ ETLBySetSpecs

Returns a new instance of ETLBySetSpecs.



4
5
6
7
8
9
10
# File 'lib/cdmdexer/etl_by_set_specs.rb', line 4

def initialize(set_specs: [:missing_setspec],
               etl_config: :missing_etl_config,
               etl_worker_klass: ETLWorker)
  @set_specs        = set_specs
  @etl_config       = etl_config
  @etl_worker_klass = etl_worker_klass
end

Instance Attribute Details

#etl_configObject (readonly)

Returns the value of attribute etl_config.



3
4
5
# File 'lib/cdmdexer/etl_by_set_specs.rb', line 3

def etl_config
  @etl_config
end

#etl_worker_klassObject (readonly)

Returns the value of attribute etl_worker_klass.



3
4
5
# File 'lib/cdmdexer/etl_by_set_specs.rb', line 3

def etl_worker_klass
  @etl_worker_klass
end

#set_specsObject (readonly)

Returns the value of attribute set_specs.



3
4
5
# File 'lib/cdmdexer/etl_by_set_specs.rb', line 3

def set_specs
  @set_specs
end

Instance Method Details

#run!Object



12
13
14
15
16
# File 'lib/cdmdexer/etl_by_set_specs.rb', line 12

def run!
  set_specs.map do |set_spec|
    etl_worker_klass.perform_async(etl_config.merge(set_spec: set_spec))
  end
end