Class: CDMBL::LoadWorker
- Inherits:
-
Object
- Object
- CDMBL::LoadWorker
- Includes:
- Sidekiq::Worker
- Defined in:
- lib/cdmbl/load_worker.rb
Overview
Load Records into a solr index
Instance Attribute Summary collapse
-
#deletables ⇒ Object
readonly
Returns the value of attribute deletables.
- #loader_klass ⇒ Object
-
#records ⇒ Object
readonly
Returns the value of attribute records.
-
#solr_config ⇒ Object
readonly
Returns the value of attribute solr_config.
- #solr_klass ⇒ Object
Instance Method Summary collapse
Instance Attribute Details
#deletables ⇒ Object (readonly)
Returns the value of attribute deletables.
6 7 8 |
# File 'lib/cdmbl/load_worker.rb', line 6 def deletables @deletables end |
#loader_klass ⇒ Object
15 16 17 |
# File 'lib/cdmbl/load_worker.rb', line 15 def loader_klass @loader_klass ||= Loader end |
#records ⇒ Object (readonly)
Returns the value of attribute records.
6 7 8 |
# File 'lib/cdmbl/load_worker.rb', line 6 def records @records end |
#solr_config ⇒ Object (readonly)
Returns the value of attribute solr_config.
6 7 8 |
# File 'lib/cdmbl/load_worker.rb', line 6 def solr_config @solr_config end |
#solr_klass ⇒ Object
19 20 21 |
# File 'lib/cdmbl/load_worker.rb', line 19 def solr_klass @solr_klass ||= DefaultSolr end |
Instance Method Details
#load! ⇒ Object
23 24 25 26 27 |
# File 'lib/cdmbl/load_worker.rb', line 23 def load! loader_klass.new(records: records, deletable_ids: deletables, solr_client: solr_client).load! end |
#perform(records = [], deletables = [], solr_config = {}) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/cdmbl/load_worker.rb', line 8 def perform(records = [], deletables = [], solr_config = {}) @solr_config = solr_config.symbolize_keys @records = records @deletables = deletables load! end |