Sha256: c1fa3a7b750920b1cc81cbf3fac7e68224632561e5ea6ce945e3558fc563944a

Contents?: true

Size: 446 Bytes

Versions: 6

Compression:

Stored size: 446 Bytes

Contents

# frozen_string_literal: true

module Datacite
  # The JSON request to create a random DOI
  class AutogenerateDoiRequestBody
    # @param [String] prefix
    def initialize(prefix:)
      @prefix = prefix
    end

    # @returns [Hash]
    def to_json(*_args)
      {
        data: {
          type: "dois",
          attributes: {
            prefix: prefix
          }
        }
      }
    end

    private

    attr_reader :prefix
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
datacite-0.4.0 lib/datacite/autogenerate_doi_request_body.rb
datacite-0.3.0 lib/datacite/autogenerate_doi_request_body.rb
datacite-0.2.3 lib/datacite/autogenerate_doi_request_body.rb
datacite-0.2.2 lib/datacite/autogenerate_doi_request_body.rb
datacite-0.2.1 lib/datacite/autogenerate_doi_request_body.rb
datacite-0.2.0 lib/datacite/autogenerate_doi_request_body.rb