Class: DorIndexing::Indexers::ReleasableIndexer
- Inherits:
-
Object
- Object
- DorIndexing::Indexers::ReleasableIndexer
- Defined in:
- lib/dor_indexing/indexers/releasable_indexer.rb
Overview
Indexes the object’s release tags
Instance Attribute Summary collapse
-
#cocina ⇒ Object
readonly
Returns the value of attribute cocina.
-
#parent_collections ⇒ Object
readonly
Returns the value of attribute parent_collections.
-
#release_tags_finder ⇒ Object
readonly
Returns the value of attribute release_tags_finder.
Instance Method Summary collapse
-
#initialize(cocina:, parent_collections:, release_tags_finder:) ⇒ ReleasableIndexer
constructor
A new instance of ReleasableIndexer.
-
#to_solr ⇒ Hash
The partial solr document for releasable concerns.
Constructor Details
#initialize(cocina:, parent_collections:, release_tags_finder:) ⇒ ReleasableIndexer
Returns a new instance of ReleasableIndexer.
9 10 11 12 13 |
# File 'lib/dor_indexing/indexers/releasable_indexer.rb', line 9 def initialize(cocina:, parent_collections:, release_tags_finder:, **) @cocina = cocina @parent_collections = parent_collections @release_tags_finder = end |
Instance Attribute Details
#cocina ⇒ Object (readonly)
Returns the value of attribute cocina.
7 8 9 |
# File 'lib/dor_indexing/indexers/releasable_indexer.rb', line 7 def cocina @cocina end |
#parent_collections ⇒ Object (readonly)
Returns the value of attribute parent_collections.
7 8 9 |
# File 'lib/dor_indexing/indexers/releasable_indexer.rb', line 7 def parent_collections @parent_collections end |
#release_tags_finder ⇒ Object (readonly)
Returns the value of attribute release_tags_finder.
7 8 9 |
# File 'lib/dor_indexing/indexers/releasable_indexer.rb', line 7 def @release_tags_finder end |
Instance Method Details
#to_solr ⇒ Hash
Returns the partial solr document for releasable concerns.
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/dor_indexing/indexers/releasable_indexer.rb', line 16 def to_solr return {} if .blank? { 'released_to_ssim' => .map(&:to).uniq, 'released_to_searchworks_dttsi' => searchworks_release_date, 'released_to_earthworks_dttsi' => earthworks_release_date, 'released_to_purl_sitemap_dttsi' => purl_sitemap_release_date }.compact end |