Class: Acme::Client::Resources::Order
- Inherits:
-
Object
- Object
- Acme::Client::Resources::Order
- Defined in:
- lib/acme/client/resources/order.rb
Instance Attribute Summary collapse
-
#authorization_urls ⇒ Object
readonly
Returns the value of attribute authorization_urls.
-
#certificate_url ⇒ Object
readonly
Returns the value of attribute certificate_url.
-
#contact ⇒ Object
readonly
Returns the value of attribute contact.
-
#expires ⇒ Object
readonly
Returns the value of attribute expires.
-
#finalize_url ⇒ Object
readonly
Returns the value of attribute finalize_url.
-
#identifiers ⇒ Object
readonly
Returns the value of attribute identifiers.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #authorizations ⇒ Object
- #certificate(force_chain: nil) ⇒ Object
- #finalize(csr:) ⇒ Object
-
#initialize(client, **arguments) ⇒ Order
constructor
A new instance of Order.
- #reload ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(client, **arguments) ⇒ Order
Returns a new instance of Order.
6 7 8 9 |
# File 'lib/acme/client/resources/order.rb', line 6 def initialize(client, **arguments) @client = client assign_attributes(**arguments) end |
Instance Attribute Details
#authorization_urls ⇒ Object (readonly)
Returns the value of attribute authorization_urls.
4 5 6 |
# File 'lib/acme/client/resources/order.rb', line 4 def @authorization_urls end |
#certificate_url ⇒ Object (readonly)
Returns the value of attribute certificate_url.
4 5 6 |
# File 'lib/acme/client/resources/order.rb', line 4 def certificate_url @certificate_url end |
#contact ⇒ Object (readonly)
Returns the value of attribute contact.
4 5 6 |
# File 'lib/acme/client/resources/order.rb', line 4 def contact @contact end |
#expires ⇒ Object (readonly)
Returns the value of attribute expires.
4 5 6 |
# File 'lib/acme/client/resources/order.rb', line 4 def expires @expires end |
#finalize_url ⇒ Object (readonly)
Returns the value of attribute finalize_url.
4 5 6 |
# File 'lib/acme/client/resources/order.rb', line 4 def finalize_url @finalize_url end |
#identifiers ⇒ Object (readonly)
Returns the value of attribute identifiers.
4 5 6 |
# File 'lib/acme/client/resources/order.rb', line 4 def identifiers @identifiers end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/acme/client/resources/order.rb', line 4 def status @status end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
4 5 6 |
# File 'lib/acme/client/resources/order.rb', line 4 def url @url end |
Instance Method Details
#authorizations ⇒ Object
16 17 18 19 20 |
# File 'lib/acme/client/resources/order.rb', line 16 def @authorization_urls.map do || @client.(url: ) end end |
#certificate(force_chain: nil) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/acme/client/resources/order.rb', line 27 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 |
#finalize(csr:) ⇒ Object
22 23 24 25 |
# File 'lib/acme/client/resources/order.rb', line 22 def finalize(csr:) assign_attributes(**@client.finalize(url: finalize_url, csr: csr).to_h) true end |
#reload ⇒ Object
11 12 13 14 |
# File 'lib/acme/client/resources/order.rb', line 11 def reload assign_attributes(**@client.order(url: url).to_h) true end |
#to_h ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/acme/client/resources/order.rb', line 35 def to_h { url: url, status: status, expires: expires, finalize_url: finalize_url, authorization_urls: , identifiers: identifiers, certificate_url: certificate_url } end |