Class: Acme::Client::Resources::Challenges::Base
- Inherits:
-
Object
- Object
- Acme::Client::Resources::Challenges::Base
- Defined in:
- lib/acme/client/resources/challenges/base.rb
Instance Attribute Summary collapse
-
#authorization ⇒ Object
readonly
Returns the value of attribute authorization.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
- #assign_attributes(attributes) ⇒ Object
- #client ⇒ Object
-
#initialize(authorization) ⇒ Base
constructor
A new instance of Base.
- #request_verification ⇒ Object
- #verify_status ⇒ Object
Constructor Details
#initialize(authorization) ⇒ Base
Returns a new instance of Base.
4 5 6 |
# File 'lib/acme/client/resources/challenges/base.rb', line 4 def initialize() @authorization = end |
Instance Attribute Details
#authorization ⇒ Object (readonly)
Returns the value of attribute authorization.
2 3 4 |
# File 'lib/acme/client/resources/challenges/base.rb', line 2 def @authorization end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
2 3 4 |
# File 'lib/acme/client/resources/challenges/base.rb', line 2 def error @error end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
2 3 4 |
# File 'lib/acme/client/resources/challenges/base.rb', line 2 def status @status end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
2 3 4 |
# File 'lib/acme/client/resources/challenges/base.rb', line 2 def token @token end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
2 3 4 |
# File 'lib/acme/client/resources/challenges/base.rb', line 2 def uri @uri end |
Instance Method Details
#assign_attributes(attributes) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/acme/client/resources/challenges/base.rb', line 23 def assign_attributes(attributes) @status = attributes.fetch('status', 'pending') @uri = attributes.fetch('uri') @token = attributes.fetch('token') @error = attributes['error'] end |
#client ⇒ Object
8 9 10 |
# File 'lib/acme/client/resources/challenges/base.rb', line 8 def client .client end |
#request_verification ⇒ Object
18 19 20 21 |
# File 'lib/acme/client/resources/challenges/base.rb', line 18 def request_verification response = client.connection.post(@uri, resource: 'challenge', type: challenge_type, keyAuthorization: ) response.success? end |
#verify_status ⇒ Object
12 13 14 15 16 |
# File 'lib/acme/client/resources/challenges/base.rb', line 12 def verify_status .verify_status status end |