Class: Datacite::Mapping::FromCocina::Descriptions

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

Overview

Transform the Cocina::Models::Description note attributes to the DataCite descriptions attributes

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(description:) ⇒ Descriptions



16
17
18
# File 'lib/datacite/mapping/from_cocina/descriptions.rb', line 16

def initialize(description:)
  @description = description
end

Class Method Details

.buildNilClass, Array<Hash>

HTTP PUT request to DataCite



12
13
14
# File 'lib/datacite/mapping/from_cocina/descriptions.rb', line 12

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

Instance Method Details

#callNilClass, Array<Hash>

HTTP PUT request to DataCite



22
23
24
25
26
27
28
29
# File 'lib/datacite/mapping/from_cocina/descriptions.rb', line 22

def call
  return unless abstract

  [{
    description: abstract,
    descriptionType: 'Abstract'
  }]
end