Class: CDMDEXER::TransformWorker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Worker
Defined in:
lib/cdmdexer/transform_worker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#batch_sizeObject (readonly)

Returns the value of attribute batch_size.



5
6
7
# File 'lib/cdmdexer/transform_worker.rb', line 5

def batch_size
  @batch_size
end

#cdm_endpointObject (readonly)

Returns the value of attribute cdm_endpoint.



5
6
7
# File 'lib/cdmdexer/transform_worker.rb', line 5

def cdm_endpoint
  @cdm_endpoint
end

#cdm_item_klassObject



34
35
36
# File 'lib/cdmdexer/transform_worker.rb', line 34

def cdm_item_klass
  @cdm_item_klass ||= CdmItem
end

#field_mappingsObject (readonly)

Returns the value of attribute field_mappings.



5
6
7
# File 'lib/cdmdexer/transform_worker.rb', line 5

def field_mappings
  @field_mappings
end

#load_worker_klassObject



42
43
44
# File 'lib/cdmdexer/transform_worker.rb', line 42

def load_worker_klass
  @load_worker_klass ||= LoadWorker
end

#oai_endpointObject (readonly)

Returns the value of attribute oai_endpoint.



5
6
7
# File 'lib/cdmdexer/transform_worker.rb', line 5

def oai_endpoint
  @oai_endpoint
end

#recordsObject (readonly)

Returns the value of attribute records.



5
6
7
# File 'lib/cdmdexer/transform_worker.rb', line 5

def records
  @records
end

#solr_configObject (readonly)

Returns the value of attribute solr_config.



5
6
7
# File 'lib/cdmdexer/transform_worker.rb', line 5

def solr_config
  @solr_config
end

#transformer_klassObject



38
39
40
# File 'lib/cdmdexer/transform_worker.rb', line 38

def transformer_klass
  @transformer_klass ||= Transformer
end

#transformer_worker_klassObject



46
47
48
# File 'lib/cdmdexer/transform_worker.rb', line 46

def transformer_worker_klass
  @transformer_worker_klass ||= TransformWorker
end

Instance Method Details

#perform(records, solr_config, cdm_endpoint, oai_endpoint, field_mappings, batch_size) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/cdmdexer/transform_worker.rb', line 17

def perform(records,
            solr_config,
            cdm_endpoint,
            oai_endpoint,
            field_mappings,
            batch_size)

  @records           = records
  @solr_config       = solr_config
  @cdm_endpoint      = cdm_endpoint
  @oai_endpoint      = oai_endpoint
  @field_mappings    = field_mappings
  @batch_size        = batch_size
  transform_and_load!
  transform_and_load_compounds!
end