Class: Datacite::Mapping::NameIdentifier

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

Overview

Uniquely identifies an individual or legal entity, according to various schemes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scheme:, value:, scheme_uri: nil) ⇒ NameIdentifier

Parameters:

  • scheme (Scheme)

    the name identifier scheme. Cannot be nil.

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

    the URI of the identifier scheme. Optional.

  • value (String)

    the identifier value. Cannot be nil.



15
16
17
18
19
# File 'lib/datacite/mapping/name_identifier.rb', line 15

def initialize(scheme:, value:, scheme_uri: nil)
  self.scheme = scheme
  self.scheme_uri = scheme_uri
  self.value = value
end

Instance Attribute Details

#schemeString

Returns the name identifier scheme. Cannot be nil.

Returns:

  • (String)

    the name identifier scheme. Cannot be nil.



37
# File 'lib/datacite/mapping/name_identifier.rb', line 37

text_node :scheme, '@nameIdentifierScheme'

#scheme_uriURI?

Returns the URI of the identifier scheme. Optional.

Returns:

  • (URI, nil)

    the URI of the identifier scheme. Optional.



41
# File 'lib/datacite/mapping/name_identifier.rb', line 41

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

#valueString

Returns the identifier value. Cannot be nil.

Returns:

  • (String)

    the identifier value. Cannot be nil.



45
# File 'lib/datacite/mapping/name_identifier.rb', line 45

text_node :value, 'text()'