Class: SdrClient::RedesignedClient::Find

Inherits:
Object
  • Object
show all
Defined in:
lib/sdr_client/redesigned_client/find.rb

Overview

Find an object

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object_id:) ⇒ Find

Returns a new instance of Find.

Parameters:

  • object_id (String)

    an ID for an object



14
15
16
# File 'lib/sdr_client/redesigned_client/find.rb', line 14

def initialize(object_id:)
  @object_id = object_id
end

Class Method Details

.runObject



9
10
11
# File 'lib/sdr_client/redesigned_client/find.rb', line 9

def self.run(...)
  new(...).run
end

Instance Method Details

#runString

Returns JSON for the given Cocina object or an error.

Returns:

  • (String)

    JSON for the given Cocina object or an error

Raises:

  • (Failed)

    if the find operation fails



20
21
22
23
# File 'lib/sdr_client/redesigned_client/find.rb', line 20

def run
  logger.info("Retrieving metadata from: #{path}")
  client.get(path: path)
end