Class: Datacite::Mapping::FromCocina::Types
- Inherits:
-
Object
- Object
- Datacite::Mapping::FromCocina::Types
- Defined in:
- lib/datacite/mapping/from_cocina/types.rb
Overview
Transform the Cocina::Models::Description form attributes to the DataCite types attributes
see https://support.datacite.org/reference/dois-2#put_dois-id
Class Method Summary collapse
-
.build ⇒ NilClass, Hash
to DataCite.
Instance Method Summary collapse
-
#call ⇒ NilClass, Hash
to DataCite.
-
#initialize(description:) ⇒ Types
constructor
A new instance of Types.
Constructor Details
#initialize(description:) ⇒ Types
16 17 18 |
# File 'lib/datacite/mapping/from_cocina/types.rb', line 16 def initialize(description:) @description = description end |
Class Method Details
.build ⇒ NilClass, Hash
to DataCite
12 13 14 |
# File 'lib/datacite/mapping/from_cocina/types.rb', line 12 def self.build(...) new(...).call end |
Instance Method Details
#call ⇒ NilClass, Hash
to DataCite
22 23 24 25 26 27 28 29 |
# File 'lib/datacite/mapping/from_cocina/types.rb', line 22 def call return unless resource_type_general || resource_type { resourceTypeGeneral: resource_type_general, resourceType: resource_type || '' } end |