Class: Datacite::RegisterDoiRequestBody
- Inherits:
-
Object
- Object
- Datacite::RegisterDoiRequestBody
- Defined in:
- lib/datacite/register_doi_request_body.rb
Overview
The JSON request to create a specific DOI
Instance Method Summary collapse
-
#initialize(prefix:, suffix:) ⇒ RegisterDoiRequestBody
constructor
A new instance of RegisterDoiRequestBody.
- #to_json(*_args) ⇒ Object
Constructor Details
#initialize(prefix:, suffix:) ⇒ RegisterDoiRequestBody
Returns a new instance of RegisterDoiRequestBody.
8 9 10 11 |
# File 'lib/datacite/register_doi_request_body.rb', line 8 def initialize(prefix:, suffix:) @prefix = prefix @suffix = suffix end |
Instance Method Details
#to_json(*_args) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/datacite/register_doi_request_body.rb', line 14 def to_json(*_args) { data: { type: "dois", attributes: { doi: "#{prefix}/#{suffix}" } } } end |