Class: PurlFetcher::Client::Publish

Inherits:
Object
  • Object
show all
Defined in:
lib/purl_fetcher/client/publish.rb

Overview

Publish (metadata-only) to the purl cache

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cocina:, file_uploads:) ⇒ Publish

Returns a new instance of Publish.

Parameters:

  • cocina (Cocina::Models::DRO, Cocina::Models::Collection)

    the Cocina data object

  • file_uploads (Hash<String,String>)

    map of filenames to signed_ids



13
14
15
16
# File 'lib/purl_fetcher/client/publish.rb', line 13

def initialize(cocina:, file_uploads:)
  @cocina = cocina
  @file_uploads = file_uploads
end

Class Method Details

.publishObject



7
8
9
# File 'lib/purl_fetcher/client/publish.rb', line 7

def self.publish(...)
  new(...).publish
end

Instance Method Details

#publishObject



18
19
20
21
22
# File 'lib/purl_fetcher/client/publish.rb', line 18

def publish
  logger.debug("Starting a publish request for: #{druid}")
  client.post(path:, body:)
  logger.debug("Publish request complete")
end