lib/certmeister/in_memory_store.rb in certmeister-1.2.1 vs lib/certmeister/in_memory_store.rb in certmeister-2.0.0
- old
+ new
@@ -2,10 +2,12 @@
module Certmeister
class InMemoryStore
+ include Enumerable
+
def initialize(certs = {})
@certs = certs
@healthy = true
end
@@ -20,9 +22,15 @@
end
def remove(cn)
fail_if_unhealthy
!!@certs.delete(cn)
+ end
+
+ def each
+ @certs.each do |cn, cert|
+ yield cn, cert
+ end
end
def health_check
@healthy
end