Class: Datacite::Mapping::AlternateIdentifier

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

Overview

An identifier or identifiers other than the primary Identifier applied to the Resource.

Instance Method Summary collapse

Constructor Details

#initialize(type:, value:) ⇒ AlternateIdentifier

Parameters:

  • type (String) —

    the identifier type

  • value (String) —

    the identifier value



24
25
26
27
# File 'lib/datacite/mapping/alternate_identifier.rb', line 24

def initialize(type:, value:)
  self.type = type
  self.value = value
end

Instance Method Details

#type=(val)

Sets the type. Cannot be nil.

Parameters:

  • val (String) —

    the identifier type



31
32
33
34
# File 'lib/datacite/mapping/alternate_identifier.rb', line 31

def type=(val)
  fail ArgumentError, 'No identifier type provided' unless val
  self._type = val
end

#value=(val)

Sets the value. Cannot be nil.

Parameters:

  • val (String) —

    the value



38
39
40
41
# File 'lib/datacite/mapping/alternate_identifier.rb', line 38

def value=(val)
  fail ArgumentError, 'No identifier value provided' unless val
  self._value = val
end