Class: Datacite::Mapping::ContributorName

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value:, type: nil, language: nil) ⇒ ContributorName

Returns a new instance of ContributorName.



12
13
14
15
16
# File 'lib/datacite/mapping/contributor_name.rb', line 12

def initialize(value:, type: nil, language: nil)
  self.type = type
  self.language = language
  self.value = value
end

Instance Attribute Details

#languageString?

Returns an IETF BCP 47, ISO 639-1 language code identifying the language.

Returns:

  • (String, nil)

    an IETF BCP 47, ISO 639-1 language code identifying the language.



35
# File 'lib/datacite/mapping/contributor_name.rb', line 35

text_node :language, '@xml:lang', default_value: nil

#typeNameType?

Returns the name type. Optional.

Returns:

  • (NameType, nil)

    the name type. Optional.



31
# File 'lib/datacite/mapping/contributor_name.rb', line 31

typesafe_enum_node :type, '@nameType', class: NameType, default_value: nil

#valueString

Returns the name itself.

Returns:

  • (String)

    the name itself.



39
# File 'lib/datacite/mapping/contributor_name.rb', line 39

text_node :value, 'text()'