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



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

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

Raises:

  • (ArgumentError)


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

def type=(val)
  raise ArgumentError, 'No identifier type provided' unless val

  @type = val
end

#value=(val)

Sets the value. Cannot be nil.

Parameters:

  • val (String)

    the value

Raises:

  • (ArgumentError)


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

def value=(val)
  raise ArgumentError, 'No identifier value provided' unless val

  @value = val
end