Class: Datacite::Mapping::Title

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

Overview

A name or title by which a Resource is known.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Initializes a new Datacite::Mapping::Title.

Parameters:

  • language (String, nil) (defaults to: nil)

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

  • value (String)

    the title itself.

  • type (TitleType, nil) (defaults to: nil)

    the title type. Optional.



29
30
31
32
33
# File 'lib/datacite/mapping/title.rb', line 29

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

Instance Attribute Details

#languageString

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

Returns:

  • (String)

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



48
# File 'lib/datacite/mapping/title.rb', line 48

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

#typeTitleType?

Returns the title type. Optional.

Returns:

  • (TitleType, nil)

    the title type. Optional.



52
# File 'lib/datacite/mapping/title.rb', line 52

typesafe_enum_node :type, '@titleType', class: TitleType, default_value: nil

#valueString

Returns the title itself.

Returns:

  • (String)

    the title itself.



56
# File 'lib/datacite/mapping/title.rb', line 56

text_node :value, 'text()'