Class: Datacite::Mapping::Subject

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(scheme: nil, scheme_uri: nil, language: nil, value:) ⇒ Subject

Initializes a new Datacite::Mapping::Subject

Parameters:

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

    the subject scheme or classification code or authority if one is used. Optional.

  • scheme_uri (URI, nil) (defaults to: nil)

    the URI of the subject scheme or classification code or authority if one is used. Optional.

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

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

  • value (String)

    the subject itself.



17
18
19
20
21
22
# File 'lib/datacite/mapping/subject.rb', line 17

def initialize(scheme: nil, scheme_uri: nil, language: nil, value:)
  self.scheme = scheme
  self.scheme_uri = scheme_uri
  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.



44
# File 'lib/datacite/mapping/subject.rb', line 44

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

#schemeString?

Returns the subject scheme or classification code or authority if one is used. Optional.

Returns:

  • (String, nil)

    the subject scheme or classification code or authority if one is used. Optional.



36
# File 'lib/datacite/mapping/subject.rb', line 36

text_node :scheme, '@subjectScheme', default_value: nil

#scheme_uriURI?

Returns the URI of the subject scheme or classification code or authority if one is used. Optional.

Returns:

  • (URI, nil)

    the URI of the subject scheme or classification code or authority if one is used. Optional.



40
# File 'lib/datacite/mapping/subject.rb', line 40

uri_node :scheme_uri, '@schemeURI', default_value: nil

#valueString

Returns the subject itself.

Returns:

  • (String)

    the subject itself.



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

text_node :value, 'text()'