Class: Acme::Client::Resources::Directory
- Inherits:
-
Object
- Object
- Acme::Client::Resources::Directory
- Defined in:
- lib/acme/client/resources/directory.rb
Constant Summary collapse
- DIRECTORY_RESOURCES =
{ new_nonce: 'newNonce', new_account: 'newAccount', new_order: 'newOrder', new_authz: 'newAuthz', revoke_certificate: 'revokeCert', key_change: 'keyChange' }
- DIRECTORY_META =
{ terms_of_service: 'termsOfService', website: 'website', caa_identities: 'caaIdentities', external_account_required: 'externalAccountRequired' }
Instance Method Summary collapse
- #caa_identities ⇒ Object
- #endpoint_for(key) ⇒ Object
- #external_account_required ⇒ Object
-
#initialize(client, **arguments) ⇒ Directory
constructor
A new instance of Directory.
- #meta ⇒ Object
- #terms_of_service ⇒ Object
- #website ⇒ Object
Constructor Details
#initialize(client, **arguments) ⇒ Directory
Returns a new instance of Directory.
20 21 22 23 |
# File 'lib/acme/client/resources/directory.rb', line 20 def initialize(client, **arguments) @client = client assign_attributes(**arguments) end |
Instance Method Details
#caa_identities ⇒ Object
40 41 42 |
# File 'lib/acme/client/resources/directory.rb', line 40 def caa_identities [DIRECTORY_META[:caa_identities]] end |
#endpoint_for(key) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/acme/client/resources/directory.rb', line 25 def endpoint_for(key) @directory.fetch(key) do |missing_key| raise Acme::Client::Error::UnsupportedOperation, "Directory at #{@url} does not include `#{missing_key}`" end end |
#external_account_required ⇒ Object
44 45 46 |
# File 'lib/acme/client/resources/directory.rb', line 44 def external_account_required [DIRECTORY_META[:external_account_required]] end |
#meta ⇒ Object
48 49 50 |
# File 'lib/acme/client/resources/directory.rb', line 48 def @directory[:meta] end |
#terms_of_service ⇒ Object
32 33 34 |
# File 'lib/acme/client/resources/directory.rb', line 32 def terms_of_service [DIRECTORY_META[:terms_of_service]] end |
#website ⇒ Object
36 37 38 |
# File 'lib/acme/client/resources/directory.rb', line 36 def website [DIRECTORY_META[:website]] end |