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



14
15
16
17
# File 'lib/datacite/mapping/alternate_identifier.rb', line 14

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



21
22
23
24
# File 'lib/datacite/mapping/alternate_identifier.rb', line 21

def type=(val)
  fail ArgumentError, 'No identifier type provided' unless val
  @type = val
end

#value=(val)

Sets the value. Cannot be nil.

Parameters:

  • val (String)

    the value



28
29
30
31
# File 'lib/datacite/mapping/alternate_identifier.rb', line 28

def value=(val)
  fail ArgumentError, 'No identifier value provided' unless val
  @value = val
end