Class: PurlFetcher::Client::LegacyPublish

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

Overview

Publish (metadata-only). This will be replaced with a single publish operation

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cocina:) ⇒ LegacyPublish

Returns a new instance of LegacyPublish.

Parameters:

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

    the Cocina data object



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

def initialize(cocina:)
  @cocina = cocina
end

Class Method Details

.publish(cocina:) ⇒ Object

Parameters:

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

    the Cocina data object



8
9
10
# File 'lib/purl_fetcher/client/legacy_publish.rb', line 8

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

Instance Method Details

#publishObject



17
18
19
20
21
# File 'lib/purl_fetcher/client/legacy_publish.rb', line 17

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