Class: Datacite::Mapping::Rights

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

Overview

Rights information for the Resource

Constant Summary collapse

CC_ZERO =
Rights.new(
  uri: URI('https://creativecommons.org/publicdomain/zero/1.0/'),
  value: 'CC0 1.0 Universal (CC0 1.0) Public Domain Dedication'
)
CC_BY =
Rights.new(
  uri: URI('https://creativecommons.org/licenses/by/4.0/'),
  value: 'Creative Commons Attribution 4.0 International (CC BY 4.0)'
)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri: nil, identifier: nil, identifier_scheme: nil, scheme_uri: nil, language: nil, value: nil) ⇒ Rights

Initializes a new Datacite::Mapping::Rights object

Parameters:

  • uri (URI, nil) (defaults to: nil)

    a URI for the license. Optional.

  • identifier (String, nil) (defaults to: nil)

    Optional.

  • identifier_scheme (String, nil) (defaults to: nil)

    Optional.

  • scheme_url (URI, nil)

    Optional.

  • language (String, nil) (defaults to: nil)

    Optional.

  • value (String) (defaults to: nil)

    a rights statement.



20
21
22
23
24
25
26
27
# File 'lib/datacite/mapping/rights.rb', line 20

def initialize(uri: nil, identifier: nil, identifier_scheme: nil, scheme_uri: nil, language: nil, value: nil)
  self.uri = uri
  self.identifier = identifier
  self.identifier_scheme = identifier_scheme
  self.scheme_uri = scheme_uri
  self.language = language
  self.value = value
end

Instance Attribute Details

#identifierString?

Returns an identifier for the rights setting. Optional.

Returns:

  • (String, nil)

    an identifier for the rights setting. Optional.



47
# File 'lib/datacite/mapping/rights.rb', line 47

text_node :identifier, '@rightsIdentifier', default_value: nil

#identifier_schemeString?

Returns an identifier for the rights scheme. Optional.

Returns:

  • (String, nil)

    an identifier for the rights scheme. Optional.



51
# File 'lib/datacite/mapping/rights.rb', line 51

text_node :identifier_scheme, '@rightsIdentifierScheme', default_value: nil

#languageString?

Returns an IETF BCP 47, ISO 639-1 language code identifying the language.

Returns:

  • (String, nil)

    an IETF BCP 47, ISO 639-1 language code identifying the language.



43
# File 'lib/datacite/mapping/rights.rb', line 43

text_node :language, '@xml:lang', default_value: nil

#scheme_uriURI?

Returns a URI for the rights scheme. Optional.

Returns:

  • (URI, nil)

    a URI for the rights scheme. Optional.



55
# File 'lib/datacite/mapping/rights.rb', line 55

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

#uriURI?

Returns a URI for the license. Optional.

Returns:

  • (URI, nil)

    a URI for the license. Optional.



39
# File 'lib/datacite/mapping/rights.rb', line 39

uri_node :uri, '@rightsURI', default_value: nil

#valueString

Returns the rights statement. Cannot be empty or nil.

Returns:

  • (String)

    the rights statement. Cannot be empty or nil.



59
# File 'lib/datacite/mapping/rights.rb', line 59

text_node :value, 'text()', default_value: nil