class HerokuDnsimpleCert::HerokuCertificate

Attributes

app[R]
certificate_chain[R]
client[R]
private_key[R]

Public Class Methods

new(token:, app:, certificate_chain:, private_key:, client: nil) click to toggle source
# File lib/heroku_dnsimple_cert/heroku_certificate.rb, line 5
def initialize(token:, app:, certificate_chain:, private_key:, client: nil)
  @client = client || HerokuSni.new(token, app)
  @certificate_chain = certificate_chain
  @private_key = private_key
  @app = app
end

Public Instance Methods

certificates() click to toggle source
# File lib/heroku_dnsimple_cert/heroku_certificate.rb, line 12
def certificates
  @certificates ||= client.list
end
create() click to toggle source
# File lib/heroku_dnsimple_cert/heroku_certificate.rb, line 20
def create
  client.create(create_or_update_options)
end
update() click to toggle source
# File lib/heroku_dnsimple_cert/heroku_certificate.rb, line 16
def update
  client.update(certificates[0]["name"], create_or_update_options)
end

Private Instance Methods

create_or_update_options() click to toggle source
# File lib/heroku_dnsimple_cert/heroku_certificate.rb, line 26
def create_or_update_options
  {
    certificate_chain: certificate_chain,
    private_key: private_key
  }
end