Class: Certmeister::InMemoryStore
- Inherits:
-
Object
- Object
- Certmeister::InMemoryStore
- Defined in:
- lib/certmeister/in_memory_store.rb
Instance Method Summary collapse
- #fetch(cn) ⇒ Object
- #health_check ⇒ Object
-
#initialize(certs = {}) ⇒ InMemoryStore
constructor
A new instance of InMemoryStore.
- #remove(cn) ⇒ Object
- #store(cn, cert) ⇒ Object
Constructor Details
#initialize(certs = {}) ⇒ InMemoryStore
Returns a new instance of InMemoryStore.
7 8 9 10 |
# File 'lib/certmeister/in_memory_store.rb', line 7 def initialize(certs = {}) @certs = certs @healthy = true end |
Instance Method Details
#fetch(cn) ⇒ Object
17 18 19 20 |
# File 'lib/certmeister/in_memory_store.rb', line 17 def fetch(cn) fail_if_unhealthy @certs[cn] end |
#health_check ⇒ Object
27 28 29 |
# File 'lib/certmeister/in_memory_store.rb', line 27 def health_check @healthy end |
#remove(cn) ⇒ Object
22 23 24 25 |
# File 'lib/certmeister/in_memory_store.rb', line 22 def remove(cn) fail_if_unhealthy !!@certs.delete(cn) end |
#store(cn, cert) ⇒ Object
12 13 14 15 |
# File 'lib/certmeister/in_memory_store.rb', line 12 def store(cn, cert) fail_if_unhealthy @certs[cn] = cert end |