Class: DorIndexing::Indexers::EmbargoMetadataIndexer
- Inherits:
-
Object
- Object
- DorIndexing::Indexers::EmbargoMetadataIndexer
- Defined in:
- lib/dor_indexing/indexers/embargo_metadata_indexer.rb
Overview
Indexes the embargo metadata
Instance Attribute Summary collapse
-
#cocina ⇒ Object
readonly
Returns the value of attribute cocina.
Instance Method Summary collapse
-
#initialize(cocina:) ⇒ EmbargoMetadataIndexer
constructor
A new instance of EmbargoMetadataIndexer.
-
#to_solr ⇒ Hash
These fields are used by the EmbargoReleaseService in dor-services-app.
Constructor Details
#initialize(cocina:) ⇒ EmbargoMetadataIndexer
Returns a new instance of EmbargoMetadataIndexer.
9 10 11 |
# File 'lib/dor_indexing/indexers/embargo_metadata_indexer.rb', line 9 def initialize(cocina:, **) @cocina = cocina end |
Instance Attribute Details
#cocina ⇒ Object (readonly)
Returns the value of attribute cocina.
7 8 9 |
# File 'lib/dor_indexing/indexers/embargo_metadata_indexer.rb', line 7 def cocina @cocina end |
Instance Method Details
#to_solr ⇒ Hash
These fields are used by the EmbargoReleaseService in dor-services-app
15 16 17 18 19 20 21 22 23 |
# File 'lib/dor_indexing/indexers/embargo_metadata_indexer.rb', line 15 def to_solr {}.tap do |solr_doc| = (cocina) if .present? solr_doc['embargo_status_ssim'] = ['embargoed'] solr_doc['embargo_release_dtsim'] = [.utc.iso8601] end end end |