Class: PurlFetcher::Client::Unpublish
- Inherits:
-
Object
- Object
- PurlFetcher::Client::Unpublish
- Defined in:
- lib/purl_fetcher/client/unpublish.rb
Overview
Delete an item from the purl-fetcher cache
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(druid:, version:) ⇒ Unpublish
constructor
A new instance of Unpublish.
- #unpublish ⇒ Object
Constructor Details
#initialize(druid:, version:) ⇒ Unpublish
Returns a new instance of Unpublish.
16 17 18 19 |
# File 'lib/purl_fetcher/client/unpublish.rb', line 16 def initialize(druid:, version:) @druid = druid @version = version end |
Class Method Details
.unpublish(druid:, version:) ⇒ Object
10 11 12 |
# File 'lib/purl_fetcher/client/unpublish.rb', line 10 def self.unpublish(druid:, version:) new(druid:, version:).unpublish end |
Instance Method Details
#unpublish ⇒ Object
21 22 23 24 25 26 |
# File 'lib/purl_fetcher/client/unpublish.rb', line 21 def unpublish logger.debug("Starting a unpublish request for: #{druid} (#{version})") response = client.delete(path:, params: { version: version }) logger.debug("Unpublish request complete") response end |