Class: Datacite::AutogenerateDoiRequestBody

Inherits:
Object
  • Object
show all
Defined in:
lib/datacite/autogenerate_doi_request_body.rb

Overview

The JSON request to create a random DOI

Instance Method Summary collapse

Constructor Details

#initialize(prefix:) ⇒ AutogenerateDoiRequestBody

Returns a new instance of AutogenerateDoiRequestBody.

Parameters:

  • prefix (String)


7
8
9
# File 'lib/datacite/autogenerate_doi_request_body.rb', line 7

def initialize(prefix:)
  @prefix = prefix
end

Instance Method Details

#to_json(*_args) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/datacite/autogenerate_doi_request_body.rb', line 12

def to_json(*_args)
  {
    data: {
      type: "dois",
      attributes: {
        prefix: prefix
      }
    }
  }
end