Class: SulOrcidClient::ContributorMapper
- Inherits:
-
Object
- Object
- SulOrcidClient::ContributorMapper
- Defined in:
- lib/sul_orcid_client/contributor_mapper.rb
Overview
Maps a Cocina Contributor to an Orcid Contributor.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(contributor:) ⇒ ContributorMapper
constructor
A new instance of ContributorMapper.
- #map ⇒ Object
Constructor Details
#initialize(contributor:) ⇒ ContributorMapper
Returns a new instance of ContributorMapper.
10 11 12 |
# File 'lib/sul_orcid_client/contributor_mapper.rb', line 10 def initialize(contributor:) @contributor = contributor end |
Class Method Details
.map(contributor:) ⇒ Object
5 6 7 |
# File 'lib/sul_orcid_client/contributor_mapper.rb', line 5 def self.map(contributor:) new(contributor: contributor).map end |
Instance Method Details
#map ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/sul_orcid_client/contributor_mapper.rb', line 14 def map return unless CocinaSupport.cited?(contributor) { "credit-name": map_credit_name, "contributor-orcid": map_orcid, "contributor-attributes": map_attributes }.compact end |