Class: Datacite::Mapping::FromCocina::Identifiers

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

Overview

Transform the Cocina::Models::Identification to the DataCite identifier attributes

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(identification:) ⇒ Identifiers

Returns a new instance of Identifiers.



13
14
15
# File 'lib/datacite/mapping/from_cocina/identifiers.rb', line 13

def initialize(identification:)
  @identification = identification
end

Instance Attribute Details

#identificationObject (readonly)

Returns the value of attribute identification.



17
18
19
# File 'lib/datacite/mapping/from_cocina/identifiers.rb', line 17

def identification
  @identification
end

Class Method Details

.buildObject

Parameters:

  • identification (Cocina::Models::Identification)


9
10
11
# File 'lib/datacite/mapping/from_cocina/identifiers.rb', line 9

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

Instance Method Details

#callObject



19
20
21
22
23
24
# File 'lib/datacite/mapping/from_cocina/identifiers.rb', line 19

def call
  [{
    identifier: identification.doi,
    identifierType: 'DOI'
  }]
end