Class: DorIndexing::Builders::OrcidBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/dor_indexing/builders/orcid_builder.rb

Overview

Helper methods for working with Orcid in Cocina

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(contributors) ⇒ OrcidBuilder

Returns a new instance of OrcidBuilder.



18
19
20
# File 'lib/dor_indexing/builders/orcid_builder.rb', line 18

def initialize(contributors)
  @contributors = Array(contributors)
end

Class Method Details

.build(contributors) ⇒ String

Returns the list of contributor ORCIDs to index into solr.

Parameters:

  • contributors (Array<Cocina::Models::Contributor>)

Returns:

  • (String)

    the list of contributor ORCIDs to index into solr



14
15
16
# File 'lib/dor_indexing/builders/orcid_builder.rb', line 14

def self.build(contributors)
  new(contributors).build
end

Instance Method Details

#buildObject



22
23
24
# File 'lib/dor_indexing/builders/orcid_builder.rb', line 22

def build
  cited_contributors.filter_map { |contributor| orcidid(contributor) }
end