Class: Acme::Client::Resources::Authorization
- Inherits:
-
Object
- Object
- Acme::Client::Resources::Authorization
- Defined in:
- lib/acme/client/resources/authorization.rb
Instance Attribute Summary collapse
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#expires ⇒ Object
readonly
Returns the value of attribute expires.
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#wildcard ⇒ Object
readonly
Returns the value of attribute wildcard.
Instance Method Summary collapse
- #challenges ⇒ Object
- #deactivate ⇒ Object
- #dns01 ⇒ Object (also: #dns)
- #http01 ⇒ Object (also: #http)
-
#initialize(client, **arguments) ⇒ Authorization
constructor
A new instance of Authorization.
- #reload ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(client, **arguments) ⇒ Authorization
Returns a new instance of Authorization.
6 7 8 9 |
# File 'lib/acme/client/resources/authorization.rb', line 6 def initialize(client, **arguments) @client = client assign_attributes(**arguments) end |
Instance Attribute Details
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
4 5 6 |
# File 'lib/acme/client/resources/authorization.rb', line 4 def domain @domain end |
#expires ⇒ Object (readonly)
Returns the value of attribute expires.
4 5 6 |
# File 'lib/acme/client/resources/authorization.rb', line 4 def expires @expires end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
4 5 6 |
# File 'lib/acme/client/resources/authorization.rb', line 4 def identifier @identifier end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/acme/client/resources/authorization.rb', line 4 def status @status end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
4 5 6 |
# File 'lib/acme/client/resources/authorization.rb', line 4 def url @url end |
#wildcard ⇒ Object (readonly)
Returns the value of attribute wildcard.
4 5 6 |
# File 'lib/acme/client/resources/authorization.rb', line 4 def wildcard @wildcard end |
Instance Method Details
#challenges ⇒ Object
21 22 23 24 25 |
# File 'lib/acme/client/resources/authorization.rb', line 21 def challenges @challenges.map do |challenge| initialize_challenge(challenge) end end |
#deactivate ⇒ Object
11 12 13 14 |
# File 'lib/acme/client/resources/authorization.rb', line 11 def deactivate assign_attributes(**@client.(url: url).to_h) true end |
#dns01 ⇒ Object Also known as: dns
34 35 36 37 38 |
# File 'lib/acme/client/resources/authorization.rb', line 34 def dns01 @dns01 ||= challenges.find { |challenge| challenge.is_a?(Acme::Client::Resources::Challenges::DNS01) } end |
#http01 ⇒ Object Also known as: http
27 28 29 30 31 |
# File 'lib/acme/client/resources/authorization.rb', line 27 def http01 @http01 ||= challenges.find { |challenge| challenge.is_a?(Acme::Client::Resources::Challenges::HTTP01) } end |
#reload ⇒ Object
16 17 18 19 |
# File 'lib/acme/client/resources/authorization.rb', line 16 def reload assign_attributes(**@client.(url: url).to_h) true end |
#to_h ⇒ Object
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/acme/client/resources/authorization.rb', line 41 def to_h { url: url, identifier: identifier, status: status, expires: expires, challenges: @challenges, wildcard: wildcard } end |