Class: SdrClient::Update

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

Overview

The namespace for the “update” command

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(druid, **options) ⇒ Update

Returns a new instance of Update.



11
12
13
14
15
# File 'lib/sdr_client/update.rb', line 11

def initialize(druid, **options)
  @druid = druid
  @url = options.fetch(:url)
  @options = options
end

Class Method Details

.run(druid, **options) ⇒ String

Returns job id for the background job result.

Returns:

  • (String)

    job id for the background job result



7
8
9
# File 'lib/sdr_client/update.rb', line 7

def self.run(druid, **options)
  new(druid, **options).run
end

Instance Method Details

#runString

Returns job id for the background job result.

Returns:

  • (String)

    job id for the background job result



18
19
20
21
22
23
24
# File 'lib/sdr_client/update.rb', line 18

def run
  SdrClient::Deposit::UpdateResource.run(
    metadata: updated_cocina_object,
    logger: options[:logger] || Logger.new($stdout),
    connection: SdrClient::Connection.new(url: url)
  )
end