Class: Datacite::Mapping::Title
- Inherits:
-
Object
- Object
- Datacite::Mapping::Title
- 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
-
#language ⇒ String
An IETF BCP 47, ISO 639-1 language code identifying the language.
-
#type ⇒ TitleType?
The title type.
-
#value ⇒ String
The title itself.
Instance Method Summary collapse
-
#initialize(value:, language: nil, type: nil) ⇒ Title
constructor
Initializes a new Title.
Constructor Details
#initialize(value:, language: nil, type: nil) ⇒ Title
Initializes a new Datacite::Mapping::Title.
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
#language ⇒ String
Returns 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 |
#type ⇒ TitleType?
Returns the title type. Optional.
52 |
# File 'lib/datacite/mapping/title.rb', line 52 typesafe_enum_node :type, '@titleType', class: TitleType, default_value: nil |
#value ⇒ String
Returns the title itself.
56 |
# File 'lib/datacite/mapping/title.rb', line 56 text_node :value, 'text()' |