Class: Digicert::CertificateDownloader

Inherits:
Base
  • Object
show all
Defined in:
lib/digicert/certificate_downloader.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Digicert::Base

Class Method Details

.fetch(certificate_id, attributes = {}) ⇒ Object



17
18
19
# File 'lib/digicert/certificate_downloader.rb', line 17

def self.fetch(certificate_id, attributes = {})
  new(attributes.merge(resource_id: certificate_id)).fetch
end

.fetch_by_format(certificate_id, format:) ⇒ Object



21
22
23
# File 'lib/digicert/certificate_downloader.rb', line 21

def self.fetch_by_format(certificate_id, format:)
  fetch(certificate_id, format: format)
end

.fetch_by_platform(certificate_id, platform:) ⇒ Object



25
26
27
# File 'lib/digicert/certificate_downloader.rb', line 25

def self.fetch_by_platform(certificate_id, platform:)
  fetch(certificate_id, platform: platform)
end

.fetch_content(certificate_id) ⇒ Object



34
35
36
# File 'lib/digicert/certificate_downloader.rb', line 34

def self.fetch_content(certificate_id)
  new(resource_id: certificate_id, format: "pem_all").fetch_content
end

.fetch_to_path(certificate_id, path:, ext: "zip", **attributes) ⇒ Object



29
30
31
32
# File 'lib/digicert/certificate_downloader.rb', line 29

def self.fetch_to_path(certificate_id, path:, ext: "zip", **attributes)
  new(attributes.merge(resource_id: certificate_id)).
    fetch_to_path(path: path, extension: ext)
end

Instance Method Details

#fetchObject



5
6
7
# File 'lib/digicert/certificate_downloader.rb', line 5

def fetch
  request_klass.new(:get, certificate_download_path).run
end

#fetch_contentObject



13
14
15
# File 'lib/digicert/certificate_downloader.rb', line 13

def fetch_content
  extract_certificate_content
end

#fetch_to_path(path:, extension: "zip") ⇒ Object



9
10
11
# File 'lib/digicert/certificate_downloader.rb', line 9

def fetch_to_path(path:, extension: "zip")
  download_to_path(path: path, extension: extension)
end