Class: Certmeister::Redis::Store

Inherits:
Object
  • Object
show all
Defined in:
lib/certmeister/redis/store.rb

Instance Method Summary collapse

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_checkObject



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