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(language: nil, value:, 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(language: nil, value:, 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.



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

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

#typeTitleType?

Returns the title type. Optional.

Returns:

  • (TitleType, nil)

    the title type. Optional.



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

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

#valueString

Returns the title itself.

Returns:

  • (String)

    the title itself.



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

text_node :value, 'text()'