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:, scheme_uri: nil, value:) ⇒ 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:, scheme_uri: nil, value:)
  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.



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

text_node :scheme, '@nameIdentifierScheme'

#scheme_uriURI?

Returns the URI of the identifier scheme. Optional.

Returns:

  • (URI, nil)

    the URI of the identifier scheme. Optional.



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

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

#valueString

Returns the identifier value. Cannot be nil.

Returns:

  • (String)

    the identifier value. Cannot be nil.



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

text_node :value, 'text()'