Sha256: becf534c75faddb88e97f715d00f4def9b37fef9885e75a987f5419eb34016d7

Contents?: true

Size: 302 Bytes

Versions: 8

Compression:

Stored size: 302 Bytes

Contents

# frozen_string_literal: true

module Datacite
  # The response object from the datacite API
  class Response
    # @param [Hash] response a json reponse
    def initialize(response)
      @body = response.body
    end

    attr_reader :body

    def doi
      body.dig("data", "id")
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
datacite-0.4.0 lib/datacite/response.rb
datacite-0.3.0 lib/datacite/response.rb
datacite-0.2.3 lib/datacite/response.rb
datacite-0.2.2 lib/datacite/response.rb
datacite-0.2.1 lib/datacite/response.rb
datacite-0.2.0 lib/datacite/response.rb
datacite-0.1.1 lib/datacite/response.rb
datacite-0.1.0 lib/datacite/response.rb