Class: Datacite::AutogenerateDoiRequestBody
- Inherits:
-
Object
- Object
- Datacite::AutogenerateDoiRequestBody
- Defined in:
- lib/datacite/autogenerate_doi_request_body.rb
Overview
The JSON request to create a random DOI
Instance Method Summary collapse
-
#initialize(prefix:) ⇒ AutogenerateDoiRequestBody
constructor
A new instance of AutogenerateDoiRequestBody.
- #to_json(*_args) ⇒ Object
Constructor Details
#initialize(prefix:) ⇒ AutogenerateDoiRequestBody
Returns a new instance of AutogenerateDoiRequestBody.
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 |