Class: Datacite::Mapping::FunderIdentifier

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, value:) ⇒ FunderIdentifier

Returns a new instance of FunderIdentifier.

Parameters:

  • type (FunderIdentifierType)

    the identifier type. Cannot be nil.

  • value (String)

    the identifier value. Cannot be nil.



25
26
27
28
# File 'lib/datacite/mapping/funding_reference.rb', line 25

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

Instance Attribute Details

#typeFunderIdentifierType

Returns the identifier type. Cannot be nil.

Returns:



46
# File 'lib/datacite/mapping/funding_reference.rb', line 46

typesafe_enum_node :type, '@funderIdentifierType', class: FunderIdentifierType

#valueString

Returns the identifier value. Cannot be nil.

Returns:

  • (String)

    the identifier value. Cannot be nil.



50
# File 'lib/datacite/mapping/funding_reference.rb', line 50

text_node :value, 'text()'

Instance Method Details

#to_s



40
41
42
# File 'lib/datacite/mapping/funding_reference.rb', line 40

def to_s
  "#{type.value}: #{value}"
end