Class: Datacite::Mapping::FunderIdentifier
- Inherits:
-
Object
- Object
- Datacite::Mapping::FunderIdentifier
- Includes:
- XML::Mapping
- Defined in:
- lib/datacite/mapping/funding_reference.rb
Instance Attribute Summary collapse
-
#scheme_uri ⇒ URI?
The URI of the identifier scheme.
-
#type ⇒ FunderIdentifierType
The identifier type.
-
#value ⇒ String
The identifier value.
Instance Method Summary collapse
-
#initialize(type:, value:, scheme_uri: nil) ⇒ FunderIdentifier
constructor
A new instance of FunderIdentifier.
- #to_s
Constructor Details
#initialize(type:, value:, scheme_uri: nil) ⇒ FunderIdentifier
Returns a new instance of FunderIdentifier.
30 31 32 33 34 |
# File 'lib/datacite/mapping/funding_reference.rb', line 30 def initialize(type:, value:, scheme_uri: nil) self.type = type self.scheme_uri = scheme_uri self.value = value end |
Instance Attribute Details
#scheme_uri ⇒ URI?
Returns the URI of the identifier scheme. Optional.
58 |
# File 'lib/datacite/mapping/funding_reference.rb', line 58 uri_node :scheme_uri, '@schemeURI', default_value: nil |
#type ⇒ FunderIdentifierType
Returns the identifier type. Cannot be nil.
54 |
# File 'lib/datacite/mapping/funding_reference.rb', line 54 typesafe_enum_node :type, '@funderIdentifierType', class: FunderIdentifierType |
#value ⇒ String
Returns the identifier value. Cannot be nil.
62 |
# File 'lib/datacite/mapping/funding_reference.rb', line 62 text_node :value, 'text()' |
Instance Method Details
#to_s
48 49 50 |
# File 'lib/datacite/mapping/funding_reference.rb', line 48 def to_s "#{type.value}: #{value}" end |