Sha256: bc99110564451c53cbda89e26ef1c458406b6ddc0a2035e1a80336ecd6432838
Contents?: true
Size: 621 Bytes
Versions: 16
Compression:
Stored size: 621 Bytes
Contents
require 'certmeister/store_error' module Certmeister class InMemoryStore def initialize(certs = {}) @certs = certs @healthy = true end def store(cn, cert) fail_if_unhealthy @certs[cn] = cert end def fetch(cn) fail_if_unhealthy @certs[cn] end def remove(cn) fail_if_unhealthy !!@certs.delete(cn) end def health_check @healthy end private def break! @healthy = false end def fail_if_unhealthy raise Certmeister::StoreError.new("in-memory store is broken") if !@healthy end end end
Version data entries
16 entries across 16 versions & 1 rubygems