Class: DorIndexing::Indexers::DefaultObjectRightsIndexer

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

Overview

Indexes the default object rights

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cocina:) ⇒ DefaultObjectRightsIndexer

Returns a new instance of DefaultObjectRightsIndexer.



9
10
11
# File 'lib/dor_indexing/indexers/default_object_rights_indexer.rb', line 9

def initialize(cocina:, **)
  @cocina = cocina
end

Instance Attribute Details

#cocinaObject (readonly)

Returns the value of attribute cocina.



7
8
9
# File 'lib/dor_indexing/indexers/default_object_rights_indexer.rb', line 7

def cocina
  @cocina
end

Instance Method Details

#to_solrHash

Returns the partial solr document for defaultObjectRights.

Returns:

  • (Hash)

    the partial solr document for defaultObjectRights



14
15
16
17
18
19
20
21
22
23
# File 'lib/dor_indexing/indexers/default_object_rights_indexer.rb', line 14

def to_solr
  return {} unless cocina.administrative.accessTemplate

  {
    'use_statement_ssim' => use_statement,
    'copyright_ssim' => copyright,
    'rights_descriptions_ssim' => 'dark',
    'default_rights_descriptions_ssim' => Cocina::Models::Builders::RightsDescriptionBuilder.build(cocina)
  }
end