Class: Datacite::Mapping::FromCocina::Descriptions
- Inherits:
-
Object
- Object
- Datacite::Mapping::FromCocina::Descriptions
- 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
-
.build ⇒ NilClass, Array<Hash>
HTTP PUT request to DataCite.
Instance Method Summary collapse
-
#call ⇒ NilClass, Array<Hash>
HTTP PUT request to DataCite.
-
#initialize(description:) ⇒ Descriptions
constructor
A new instance of Descriptions.
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
.build ⇒ NilClass, 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
#call ⇒ NilClass, 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 |