Sha256: 806c491c5cfa20c5b81e4f4e15638cf54fcb34429272428e05a89d00fb7c0e8d
Contents?: true
Size: 1.43 KB
Versions: 13
Compression:
Stored size: 1.43 KB
Contents
# frozen_string_literal: true class Acme::Client::Resources::Order attr_reader :url, :status, :contact, :finalize_url, :identifiers, :authorization_urls, :expires, :certificate_url def initialize(client, **arguments) @client = client assign_attributes(**arguments) end def reload assign_attributes(**@client.order(url: url).to_h) true end def authorizations @authorization_urls.map do |authorization_url| @client.authorization(url: authorization_url) end end def finalize(csr:) assign_attributes(**@client.finalize(url: finalize_url, csr: csr).to_h) true end def certificate(force_chain: nil) if certificate_url @client.certificate(url: certificate_url, force_chain: force_chain) else raise Acme::Client::Error::CertificateNotReady, 'No certificate_url to collect the order' end end def to_h { url: url, status: status, expires: expires, finalize_url: finalize_url, authorization_urls: authorization_urls, identifiers: identifiers, certificate_url: certificate_url } end private def assign_attributes(url:, status:, expires:, finalize_url:, authorization_urls:, identifiers:, certificate_url: nil) @url = url @status = status @expires = expires @finalize_url = finalize_url @authorization_urls = authorization_urls @identifiers = identifiers @certificate_url = certificate_url end end
Version data entries
13 entries across 13 versions & 1 rubygems