Class: AcmeManager::Certificate
- Inherits:
-
Object
- Object
- AcmeManager::Certificate
- Defined in:
- lib/acme_manager/certificate.rb
Overview
Represents a certificaate managed by acme-manager
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#not_after ⇒ Object
Returns the value of attribute not_after.
Class Method Summary collapse
-
.all ⇒ Array<Certificate>
Fetch a list of all certificates that acme-manager is currently managing.
Instance Method Summary collapse
-
#expired? ⇒ Boolean
Certificate is expired when we’re past it’s expiry time.
-
#initialize(name, not_after) ⇒ Certificate
constructor
A new instance of Certificate.
Constructor Details
#initialize(name, not_after) ⇒ Certificate
Returns a new instance of Certificate.
8 9 10 11 |
# File 'lib/acme_manager/certificate.rb', line 8 def initialize(name, not_after) self.name = name self.not_after = not_after end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/acme_manager/certificate.rb', line 4 def name @name end |
#not_after ⇒ Object
Returns the value of attribute not_after.
4 5 6 |
# File 'lib/acme_manager/certificate.rb', line 4 def not_after @not_after end |
Class Method Details
.all ⇒ Array<Certificate>
Fetch a list of all certificates that acme-manager is currently managing
21 22 23 24 25 26 |
# File 'lib/acme_manager/certificate.rb', line 21 def self.all Request.make('list').map do |cert_info| AcmeManager.logger.info "Requesting list of certificates" new(cert_info['name'], Time.iso8601(cert_info['not_after'])) end end |
Instance Method Details
#expired? ⇒ Boolean
Certificate is expired when we’re past it’s expiry time
14 15 16 |
# File 'lib/acme_manager/certificate.rb', line 14 def expired? Time.now.utc > not_after end |