Class: CDMBL::TransformWorker

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cache_klassObject



60
61
62
# File 'lib/cdmbl/transform_worker.rb', line 60

def cache_klass
  @cache_klass ||= Rails
end

#cdm_api_klassObject



44
45
46
# File 'lib/cdmbl/transform_worker.rb', line 44

def cdm_api_klass
  @cdm_api_klass ||= CONTENTdmAPI::Item
end

#cdm_endpointObject (readonly)

Returns the value of attribute cdm_endpoint.



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

def cdm_endpoint
  @cdm_endpoint
end

#cdm_notification_klassObject



48
49
50
# File 'lib/cdmbl/transform_worker.rb', line 48

def cdm_notification_klass
  @cdm_notification_klass ||= CdmNotification
end

#extract_compoundsObject (readonly)

Returns the value of attribute extract_compounds.



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

def extract_compounds
  @extract_compounds
end

#field_mappingsObject (readonly)

Returns the value of attribute field_mappings.



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

def field_mappings
  @field_mappings
end

#identifiersObject (readonly)

Returns the value of attribute identifiers.



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

def identifiers
  @identifiers
end

#load_worker_klassObject



56
57
58
# File 'lib/cdmbl/transform_worker.rb', line 56

def load_worker_klass
  @load_worker_klass ||= LoadWorker
end

#oai_endpointObject (readonly)

Returns the value of attribute oai_endpoint.



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

def oai_endpoint
  @oai_endpoint
end

#oai_request_klassObject



40
41
42
# File 'lib/cdmbl/transform_worker.rb', line 40

def oai_request_klass
  @oai_request_klass ||= OaiRequest
end

#oai_set_lookup_klassObject



36
37
38
# File 'lib/cdmbl/transform_worker.rb', line 36

def oai_set_lookup_klass
  @oai_set_lookup_klass ||= OAISetLookup
end

#solr_configObject (readonly)

Returns the value of attribute solr_config.



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

def solr_config
  @solr_config
end

#transformer_klassObject



52
53
54
# File 'lib/cdmbl/transform_worker.rb', line 52

def transformer_klass
  @transformer_klass ||= Transformer
end

Instance Method Details

#perform(identifiers, solr_config, cdm_endpoint, oai_endpoint, field_mappings, extract_compounds) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/cdmbl/transform_worker.rb', line 20

def perform(identifiers,
            solr_config,
            cdm_endpoint,
            oai_endpoint,
            field_mappings,
            extract_compounds)

  @identifiers       = identifiers
  @solr_config       = solr_config
  @cdm_endpoint      = cdm_endpoint
  @oai_endpoint      = oai_endpoint
  @field_mappings    = field_mappings
  @extract_compounds = extract_compounds
  transform_and_load!
end