Class: Certmeister::Redis::Store
- Inherits:
-
Object
- Object
- Certmeister::Redis::Store
- Defined in:
- lib/certmeister/redis/store.rb
Instance Method Summary collapse
- #fetch(cn) ⇒ Object
- #health_check ⇒ Object
-
#initialize(redis, environment = "development") ⇒ Store
constructor
A new instance of Store.
- #remove(cn) ⇒ Object
- #store(cn, pem) ⇒ Object
Constructor Details
#initialize(redis, environment = "development") ⇒ Store
Returns a new instance of Store.
7 8 9 10 11 |
# File 'lib/certmeister/redis/store.rb', line 7 def initialize(redis, environment = "development") @redis = redis @environment = environment @healthy = true end |
Instance Method Details
#fetch(cn) ⇒ Object
17 18 19 |
# File 'lib/certmeister/redis/store.rb', line 17 def fetch(cn) @redis.get(pem_key(cn)) end |
#health_check ⇒ Object
26 27 28 |
# File 'lib/certmeister/redis/store.rb', line 26 def health_check @healthy end |
#remove(cn) ⇒ Object
21 22 23 24 |
# File 'lib/certmeister/redis/store.rb', line 21 def remove(cn) num_removed = @redis.del(pem_key(cn)) num_removed == 1 end |
#store(cn, pem) ⇒ Object
13 14 15 |
# File 'lib/certmeister/redis/store.rb', line 13 def store(cn, pem) @redis.set(pem_key(cn), pem) end |