Class: Datacite::Mapping::FromCocina::ContributorAttributes

Inherits:
Object
  • Object
show all
Defined in:
lib/datacite/mapping/from_cocina/contributor_attributes.rb

Overview

Transform the Cocina::Models::Description to contributor attributes

see https://support.datacite.org/reference/dois-2#put_dois-id

Constant Summary collapse

DATACITE_PERSON_CONTRIBUTOR_TYPES =

rubocop:disable Metrics/ClassLength

{
  'copyright holder' => 'RightsHolder',
  'compiler' => 'DataCollector',
  'editor' => 'Editor',
  'organizer' => 'Supervisor',
  'research team head' => 'ProjectLeader',
  'researcher' => 'Researcher'
}.freeze
DATACITE_ORGANIZATION_CONTRIBUTOR_TYPES =
{
  'copyright holder' => 'RightsHolder',
  'compiler' => 'DataCollector',
  'distributor' => 'Distributor',
  'host institution' => 'HostingInstitution',
  'issuing body' => 'Distributor',
  'publisher' => 'Distributor',
  'researcher' => 'ResearchGroup',
  'sponsor' => 'Sponsor'
}.freeze

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(description:) ⇒ ContributorAttributes



35
36
37
# File 'lib/datacite/mapping/from_cocina/contributor_attributes.rb', line 35

def initialize(description:)
  @description = description
end

Class Method Details

.buildHash



31
32
33
# File 'lib/datacite/mapping/from_cocina/contributor_attributes.rb', line 31

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

Instance Method Details

#callHash



40
41
42
43
44
45
46
# File 'lib/datacite/mapping/from_cocina/contributor_attributes.rb', line 40

def call
  {
    creators: datacite_creators,
    contributors: datacite_contributors,
    fundingReferences: datacite_funders
  }
end