class Datacite::Mapping::RelatedIdentifier
Globally unique identifier of a related resource.
Public Class Methods
new(relation_type:, value:, identifier_type:, related_metadata_scheme: nil, scheme_uri: nil, scheme_type: nil)
click to toggle source
Initializes a new {RelatedIdentifier}. @param relation_type [RelationType] the relationship of the {Resource} to the related resource. Cannot be nil. @param value [String] the identifier value. Cannot be nil. @param identifier_type [RelatedIdentifierType] the type of the related identifier. Cannot be nil. @param related_metadata_scheme [String, nil] the name of the metadata scheme. Used only with ‘HasMetadata`/`IsMetadataFor`. Optional. @param scheme_uri [URI, nil] the URI of the metadata scheme. Used only with `HasMetadata`/`IsMetadataFor`. Optional. @param scheme_type [String, nil] the type of the metadata scheme. Used only with `HasMetadata`/`IsMetadataFor`. Optional.
# File lib/datacite/mapping/related_identifier.rb, line 206 def initialize(relation_type:, value:, identifier_type:, related_metadata_scheme: nil, scheme_uri: nil, scheme_type: nil) self.relation_type = relation_type self.value = value self.identifier_type = identifier_type self.related_metadata_scheme = related_metadata_scheme self.scheme_uri = scheme_uri self.scheme_type = scheme_type end
Public Instance Methods
identifier_type=(value)
click to toggle source
# File lib/datacite/mapping/related_identifier.rb, line 221 def identifier_type=(value) raise ArgumentError, 'Identifier type cannot be empty or nil' unless value @identifier_type = value end
relation_type=(value)
click to toggle source
# File lib/datacite/mapping/related_identifier.rb, line 227 def relation_type=(value) raise ArgumentError, 'Relation type cannot be nil' unless value @relation_type = value end
value=(value)
click to toggle source
# File lib/datacite/mapping/related_identifier.rb, line 215 def value=(value) raise ArgumentError, 'Value cannot be empty or nil' unless value && !value.empty? @value = value end