Class: Datacite::Mapping::RelatedIdentifier

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

Overview

Globally unique identifier of a related resource.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(relation_type:, value:, identifier_type:, related_metadata_scheme: nil, scheme_uri: nil, scheme_type: nil) ⇒ RelatedIdentifier

Parameters:

  • relation_type (RelationType) —

    the relationship of the Datacite::Mapping::Resource to the related resource. Cannot be nil.

  • value (String) —

    the identifier value. Cannot be nil.

  • identifier_type (RelatedIdentifierType) —

    the type of the related identifier. Cannot be nil.

  • related_metadata_scheme (String, nil) (defaults to: nil) —

    the name of the metadata scheme. Used only with HasMetadata/IsMetadataFor. Optional.

  • scheme_uri (URI, nil) (defaults to: nil) —

    the URI of the metadata scheme. Used only with HasMetadata/IsMetadataFor. Optional.

  • scheme_type (String, nil) (defaults to: nil) —

    the type of the metadata scheme. Used only with HasMetadata/IsMetadataFor. Optional.



184
185
186
187
188
189
190
191
# File 'lib/datacite/mapping/related_identifier.rb', line 184

def initialize(relation_type:, value:, identifier_type:, related_metadata_scheme: nil, scheme_uri: nil, scheme_type: nil) # rubocop:disable Metrics/ParameterLists
  self.relation_type = relation_type
  self.value = value
  self.identifier_type = identifier_type
  self. = 
  self.scheme_uri = scheme_uri
  self.scheme_type = scheme_type
end

Instance Attribute Details

#identifier_type ⇒ RelatedIdentifierType

Returns the type of the related identifier. Cannot be nil.

Returns:



156
# File 'lib/datacite/mapping/related_identifier.rb', line 156

typesafe_enum_node :identifier_type, '@relatedIdentifierType', class: RelatedIdentifierType

Returns the name of the metadata scheme. Used only with HasMetadata/IsMetadataFor. Optional.

Returns:

  • (String, nil) —

    the name of the metadata scheme. Used only with HasMetadata/IsMetadataFor. Optional.



160
# File 'lib/datacite/mapping/related_identifier.rb', line 160

text_node :related_metadata_scheme, '@relatedMetadataScheme', default_value: nil

#relation_type ⇒ RelationType

Returns the relationship of the Datacite::Mapping::Resource to the related resource. Cannot be nil.

Returns:



148
# File 'lib/datacite/mapping/related_identifier.rb', line 148

typesafe_enum_node :relation_type, '@relationType', class: RelationType

#scheme_type ⇒ String?

Returns the type of the metadata scheme. Used only with HasMetadata/IsMetadataFor. Optional.

Returns:

  • (String, nil) —

    the type of the metadata scheme. Used only with HasMetadata/IsMetadataFor. Optional.



168
# File 'lib/datacite/mapping/related_identifier.rb', line 168

text_node :scheme_type, '@schemeType', default_value: nil

#scheme_uri ⇒ URI?

Returns the URI of the metadata scheme. Used only with HasMetadata/IsMetadataFor. Optional.

Returns:

  • (URI, nil) —

    the URI of the metadata scheme. Used only with HasMetadata/IsMetadataFor. Optional.



164
# File 'lib/datacite/mapping/related_identifier.rb', line 164

uri_node :scheme_uri, '@schemeURI', default_value: nil

#value ⇒ String

Returns the identifier value. Cannot be nil.

Returns:

  • (String) —

    the identifier value. Cannot be nil.



152
# File 'lib/datacite/mapping/related_identifier.rb', line 152

text_node :value, 'text()'