Class: Dor::ReleasableIndexer
- Inherits:
-
Object
- Object
- Dor::ReleasableIndexer
- Includes:
- SolrDocHelper
- Defined in:
- lib/dor/indexers/releasable_indexer.rb
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
-
#initialize(resource:) ⇒ ReleasableIndexer
constructor
A new instance of ReleasableIndexer.
-
#to_solr ⇒ Hash
The partial solr document for releasable concerns.
Methods included from SolrDocHelper
Constructor Details
#initialize(resource:) ⇒ ReleasableIndexer
Returns a new instance of ReleasableIndexer.
8 9 10 |
# File 'lib/dor/indexers/releasable_indexer.rb', line 8 def initialize(resource:) @resource = resource end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
7 8 9 |
# File 'lib/dor/indexers/releasable_indexer.rb', line 7 def resource @resource end |
Instance Method Details
#to_solr ⇒ Hash
Returns the partial solr document for releasable concerns.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/dor/indexers/releasable_indexer.rb', line 13 def to_solr solr_doc = {} # TODO: sort of worried about the performance impact in bulk reindex # situations, since released_for recurses all parent collections. jmartin 2015-07-14 resource.released_for(true).each do |release_target, release_info| add_solr_value(solr_doc, 'released_to', release_target, :symbol, []) if release_info['release'] end # TODO: need to solrize whether item is released to purl? does released_for return that? # logic is: "True when there is a published lifecycle and Access Rights is anything but Dark" solr_doc end |