Sha256: 3150ea4e62e25ab86c6671b7fd6650ab8aa5a20da5a04246b1c3da7f07a55ea7

Contents?: true

Size: 933 Bytes

Versions: 3

Compression:

Stored size: 933 Bytes

Contents

# frozen_string_literal: true

module Preservation
  class Client
    # API calls that are about Preserved Objects
    class Objects < VersionedApiService

      # @param [String] druid - with or without prefix: 'druid:ab123cd4567' OR 'ab123cd4567'
      # @return [Integer] the current version of the Preserved Object
      def current_version(druid)
        resp_body = get_json("objects/#{druid}.json", druid, 'current_version')
        resp_body[:current_version]
      end

      # @param [Array] druids - required list of druids with or without prefix: 'druid:ab123cd4567' OR 'ab123cd4567'
      # @param [String] :resp_format - desired format of the HTTP response (default csv, json also possible)
      # @return body of HTTP response from Preservation API
      def checksums(druids: [], resp_format: 'csv')
        post('objects/checksums', { druids: druids, format: resp_format }, 'checksums')
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
preservation-client-0.2.2 lib/preservation/client/objects.rb
preservation-client-0.2.1 lib/preservation/client/objects.rb
preservation-client-0.2.0 lib/preservation/client/objects.rb