Class: Dor::ProcessableIndexer
- Inherits:
-
Object
- Object
- Dor::ProcessableIndexer
- Includes:
- SolrDocHelper
- Defined in:
- lib/dor/indexers/processable_indexer.rb
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
-
#initialize(resource:) ⇒ ProcessableIndexer
constructor
A new instance of ProcessableIndexer.
-
#to_solr ⇒ Hash
The partial solr document for processable concerns.
Methods included from SolrDocHelper
Constructor Details
#initialize(resource:) ⇒ ProcessableIndexer
Returns a new instance of ProcessableIndexer.
8 9 10 11 |
# File 'lib/dor/indexers/processable_indexer.rb', line 8 def initialize(resource:) @resource = resource @status_service = StatusService.new(resource) end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
7 8 9 |
# File 'lib/dor/indexers/processable_indexer.rb', line 7 def resource @resource end |
Instance Method Details
#to_solr ⇒ Hash
Returns the partial solr document for processable concerns.
14 15 16 17 18 19 20 21 22 |
# File 'lib/dor/indexers/processable_indexer.rb', line 14 def to_solr {}.tap do |solr_doc| add_versions(solr_doc) add_milestones(solr_doc) solr_doc['modified_latest_dttsi'] = resource.modified_date.to_datetime.utc.strftime('%FT%TZ') add_solr_value(solr_doc, 'rights', resource.rights, :string, [:symbol]) if resource.respond_to? :rights add_status(solr_doc) end end |