Class: DorIndexing::Indexers::WorkflowsIndexer
- Inherits:
-
Object
- Object
- DorIndexing::Indexers::WorkflowsIndexer
- Defined in:
- lib/dor_indexing/indexers/workflows_indexer.rb
Overview
Indexes the object’s state in the most recent execution of every one of its workflows
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(id:, workflow_client:) ⇒ WorkflowsIndexer
constructor
A new instance of WorkflowsIndexer.
-
#to_solr ⇒ Hash
The partial solr document for workflows concerns.
Constructor Details
#initialize(id:, workflow_client:) ⇒ WorkflowsIndexer
Returns a new instance of WorkflowsIndexer.
9 10 11 12 |
# File 'lib/dor_indexing/indexers/workflows_indexer.rb', line 9 def initialize(id:, workflow_client:, **) @id = id @workflow_client = workflow_client end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/dor_indexing/indexers/workflows_indexer.rb', line 7 def id @id end |
Instance Method Details
#to_solr ⇒ Hash
Returns the partial solr document for workflows concerns.
15 16 17 18 19 20 21 22 |
# File 'lib/dor_indexing/indexers/workflows_indexer.rb', line 15 def to_solr WorkflowSolrDocument.new do |combined_doc| workflows.each do |wf| doc = WorkflowIndexer.new(workflow: wf, workflow_client:).to_solr combined_doc.merge!(doc) end end.to_h end |