Class: Dor::WorkflowsIndexer
- Inherits:
-
Object
- Object
- Dor::WorkflowsIndexer
- Defined in:
- lib/dor/indexers/workflows_indexer.rb
Overview
Indexes the objects position in workflows
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
-
#initialize(resource:) ⇒ WorkflowsIndexer
constructor
A new instance of WorkflowsIndexer.
-
#to_solr ⇒ Hash
The partial solr document for workflow concerns.
Constructor Details
#initialize(resource:) ⇒ WorkflowsIndexer
Returns a new instance of WorkflowsIndexer.
7 8 9 |
# File 'lib/dor/indexers/workflows_indexer.rb', line 7 def initialize(resource:) @resource = resource end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
6 7 8 |
# File 'lib/dor/indexers/workflows_indexer.rb', line 6 def resource @resource end |
Instance Method Details
#to_solr ⇒ Hash
Returns the partial solr document for workflow concerns.
12 13 14 15 16 17 18 19 |
# File 'lib/dor/indexers/workflows_indexer.rb', line 12 def to_solr WorkflowSolrDocument.new do |combined_doc| workflows.each do |wf| doc = WorkflowIndexer.new(workflow: wf).to_solr combined_doc.merge!(doc) end end.to_h end |