Class: Datacite::Mapping::Contributor
- Inherits:
-
Object
- Object
- Datacite::Mapping::Contributor
- Includes:
- XML::Mapping
- Defined in:
- lib/datacite/mapping/contributor.rb
Overview
The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.
Instance Attribute Summary collapse
-
#affiliations ⇒ Array<String>
The contributor's affiliations.
-
#identifier ⇒ NameIdentifier?
An identifier for the contributor.
-
#name ⇒ String
The personal name of the contributor, in the format
Family, Given
. -
#type ⇒ ContributorType
The contributor type.
Instance Method Summary collapse
-
#initialize(name:, identifier: nil, affiliations: nil, type:) ⇒ Contributor
constructor
Initializes a new Contributor.
Constructor Details
#initialize(name:, identifier: nil, affiliations: nil, type:) ⇒ Contributor
Initializes a new Datacite::Mapping::Contributor.
89 90 91 92 93 94 |
# File 'lib/datacite/mapping/contributor.rb', line 89 def initialize(name:, identifier: nil, affiliations: nil, type:) self.name = name self.identifier = identifier self.affiliations = affiliations || [] self.type = type end |
Instance Attribute Details
#affiliations ⇒ Array<String>
Returns the contributor's affiliations. Defaults to an empty list.
117 |
# File 'lib/datacite/mapping/contributor.rb', line 117 array_node :affiliations, 'affiliation', class: String, default_value: [] |
#identifier ⇒ NameIdentifier?
Returns an identifier for the contributor. Optional.
113 |
# File 'lib/datacite/mapping/contributor.rb', line 113 object_node :identifier, 'nameIdentifier', class: NameIdentifier, default_value: nil |
#name ⇒ String
Returns the personal name of the contributor, in the format Family, Given
. Cannot be empty or nil.
109 |
# File 'lib/datacite/mapping/contributor.rb', line 109 text_node :name, 'contributorName' |
#type ⇒ ContributorType
Returns the contributor type. Cannot be nil.
121 |
# File 'lib/datacite/mapping/contributor.rb', line 121 typesafe_enum_node :type, '@contributorType', class: ContributorType |