Class: Datacite::Mapping::Creator

Inherits:
Object
  • Object
show all
Includes:
XML::Mapping
Defined in:
lib/datacite/mapping/creator.rb

Overview

The main researchers involved working on the data, or the authors of the publication in priority order.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, identifier: nil, affiliations: []) ⇒ Creator

Initializes a new Datacite::Mapping::Creator.

Parameters:

  • name (String) —

    The personal name of the creator, in the format Family, Given. Cannot be empty or nil.

  • identifier (NameIdentifier, nil) (defaults to: nil) —

    An identifier for the creator. Optional.

  • affiliations (Array<Affiliation>, nil) (defaults to: []) —

    The creator's affiliations. Defaults to an empty list.



32
33
34
35
36
# File 'lib/datacite/mapping/creator.rb', line 32

def initialize(name:, identifier: nil, affiliations: [])
  self.name = name
  self.identifier = identifier
  self.affiliations = affiliations
end

Instance Attribute Details

#affiliations ⇒ Array<Affiliation>?

Returns The creator's affiliations. Defaults to an empty list.

Returns:

  • (Array<Affiliation>, nil) —

    The creator's affiliations. Defaults to an empty list.



20
# File 'lib/datacite/mapping/creator.rb', line 20

array_node :affiliations, 'affiliation', class: String, default_value: []

#identifier ⇒ NameIdentifier?

Returns An identifier for the creator. Optional.

Returns:



16
# File 'lib/datacite/mapping/creator.rb', line 16

object_node :identifier, 'nameIdentifier', class: NameIdentifier, default_value: nil

#name ⇒ String

Returns The personal name of the creator, in the format Family, Given. Cannot be empty or nil.

Returns:

  • (String) —

    The personal name of the creator, in the format Family, Given. Cannot be empty or nil.



12
# File 'lib/datacite/mapping/creator.rb', line 12

text_node :name, 'creatorName'