Class: DorIndexing::WorkflowFields

Inherits:
Object
  • Object
show all
Defined in:
lib/dor_indexing/workflow_fields.rb

Overview

Model for workflow fields

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(druid:, version:, workflow_client:) ⇒ WorkflowFields

Returns a new instance of WorkflowFields.



12
13
14
15
16
# File 'lib/dor_indexing/workflow_fields.rb', line 12

def initialize(druid:, version:, workflow_client:)
  @druid = druid
  @version = version
  @workflow_client = workflow_client
end

Instance Attribute Details

#druidObject (readonly)

Returns the value of attribute druid.



10
11
12
# File 'lib/dor_indexing/workflow_fields.rb', line 10

def druid
  @druid
end

#versionObject (readonly)

Returns the value of attribute version.



10
11
12
# File 'lib/dor_indexing/workflow_fields.rb', line 10

def version
  @version
end

#workflow_clientObject (readonly)

Returns the value of attribute workflow_client.



10
11
12
# File 'lib/dor_indexing/workflow_fields.rb', line 10

def workflow_client
  @workflow_client
end

Class Method Details

.for(druid:, version:, workflow_client:) ⇒ Object



6
7
8
# File 'lib/dor_indexing/workflow_fields.rb', line 6

def self.for(druid:, version:, workflow_client:)
  new(druid:, version:, workflow_client:).result
end

Instance Method Details

#resultHash

Returns the partial solr document for processable concerns.

Returns:

  • (Hash)

    the partial solr document for processable concerns



19
20
21
22
23
24
# File 'lib/dor_indexing/workflow_fields.rb', line 19

def result
  {}.tap do |solr_doc|
    add_sortable_milestones(solr_doc)
    add_status(solr_doc)
  end
end