Class: Datacite::Mapping::Subject
- Inherits:
-
Object
- Object
- Datacite::Mapping::Subject
- Includes:
- XML::Mapping
- Defined in:
- lib/datacite/mapping/subject.rb
Overview
Subject, keyword, classification code, or key phrase describing the Resource.
Instance Attribute Summary collapse
-
#language ⇒ String?
An IETF BCP 47, ISO 639-1 language code identifying the language.
-
#scheme ⇒ String?
The subject scheme or classification code or authority if one is used.
-
#scheme_uri ⇒ URI?
The URI of the subject scheme or classification code or authority if one is used.
-
#value ⇒ String
The subject itself.
Instance Method Summary collapse
-
#initialize(value:, scheme: nil, scheme_uri: nil, language: nil) ⇒ Subject
constructor
Initializes a new Subject.
Constructor Details
#initialize(value:, scheme: nil, scheme_uri: nil, language: nil) ⇒ Subject
Initializes a new Datacite::Mapping::Subject
17 18 19 20 21 22 |
# File 'lib/datacite/mapping/subject.rb', line 17 def initialize(value:, scheme: nil, scheme_uri: nil, language: nil) self.scheme = scheme self.scheme_uri = scheme_uri self.language = language self.value = value end |
Instance Attribute Details
#language ⇒ String?
Returns an IETF BCP 47, ISO 639-1 language code identifying the language.
45 |
# File 'lib/datacite/mapping/subject.rb', line 45 text_node :language, '@xml:lang', default_value: nil |
#scheme ⇒ String?
Returns the subject scheme or classification code or authority if one is used. Optional.
37 |
# File 'lib/datacite/mapping/subject.rb', line 37 text_node :scheme, '@subjectScheme', default_value: nil |
#scheme_uri ⇒ URI?
Returns the URI of the subject scheme or classification code or authority if one is used. Optional.
41 |
# File 'lib/datacite/mapping/subject.rb', line 41 uri_node :scheme_uri, '@schemeURI', default_value: nil |
#value ⇒ String
Returns the subject itself.
49 |
# File 'lib/datacite/mapping/subject.rb', line 49 text_node :value, 'text()' |