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, value:) ⇒ Rights

Initializes a new Datacite::Mapping::Rights object

Parameters:

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

    a URI for the license. Optional.

  • value (String)

    the rights statement. Cannot be empty or nil.



16
17
18
19
# File 'lib/datacite/mapping/rights.rb', line 16

def initialize(uri: nil, value:)
  self.uri = uri
  self.value = value
end

Instance Attribute Details

#uriURI?

Returns a URI for the license. Optional.

Returns:

  • (URI, nil)

    a URI for the license. Optional.



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

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.



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

text_node :value, 'text()'