Class: Dor::Services::Client::Objects

Inherits:
VersionedService show all
Extended by:
Deprecation
Defined in:
lib/dor/services/client/objects.rb

Overview

API calls that are about a repository objects

Instance Method Summary collapse

Methods inherited from VersionedService

#initialize

Constructor Details

This class inherits a constructor from Dor::Services::Client::VersionedService

Instance Method Details

#current_version(object:) ⇒ Integer

Gets the current version number for the object

Parameters:

  • object (String)

    the pid for the object

Returns:

  • (Integer)

    the current version

Raises:



42
43
44
# File 'lib/dor/services/client/objects.rb', line 42

def current_version(object:)
  SDR.new(connection: connection, version: api_version).current_version(object: object)
end

#notify_goobi(object:) ⇒ boolean

Notify the external Goobi system for a new object that was registered in DOR

Parameters:

  • object (String)

    the pid for the object

Returns:

  • (boolean)

    true on success

Raises:



32
33
34
# File 'lib/dor/services/client/objects.rb', line 32

def notify_goobi(object:)
  Object.new(connection: connection, version: api_version, object: object).notify_goobi
end

#publish(object:) ⇒ boolean

Publish a new object

Parameters:

  • object (String)

    the pid for the object

Returns:

  • (boolean)

    true on success

Raises:



23
24
25
# File 'lib/dor/services/client/objects.rb', line 23

def publish(object:)
  Object.new(connection: connection, version: api_version, object: object).publish
end

#register(params:) ⇒ HashWithIndifferentAccess

Creates a new object in DOR

Returns:

  • (HashWithIndifferentAccess)

    the response, which includes a :pid



14
15
16
17
# File 'lib/dor/services/client/objects.rb', line 14

def register(params:)
  json = register_response(params: params)
  JSON.parse(json).with_indifferent_access
end