Sha256: 20cf22f5204e18705b64bffb656741370ecc764ea4d1d73576c4473f69b68606

Contents?: true

Size: 383 Bytes

Versions: 14

Compression:

Stored size: 383 Bytes

Contents

module KB
  class Cache
    class << self
      def delete(key)
        instance.delete(key)
      end

      def fetch(key, &block)
        instance.fetch(key, expires_in: cache_expiration, &block)
      end

      private

      def instance
        KB.config.cache.instance
      end

      def cache_expiration
        KB.config.cache.expires_in.to_f
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
barkibu-kb-0.27.0 lib/kb/cache.rb
barkibu-kb-0.26.0 lib/kb/cache.rb
barkibu-kb-0.25.0 lib/kb/cache.rb
barkibu-kb-0.24.1 lib/kb/cache.rb
barkibu-kb-0.24.0 lib/kb/cache.rb
barkibu-kb-0.23.0 lib/kb/cache.rb
barkibu-kb-0.22.0 lib/kb/cache.rb
barkibu-kb-0.21.0 lib/kb/cache.rb
barkibu-kb-0.20.0 lib/kb/cache.rb
barkibu-kb-0.19.0 lib/kb/cache.rb
barkibu-kb-0.18.0 lib/kb/cache.rb
barkibu-kb-0.17.0 lib/kb/cache.rb
barkibu-kb-0.16.2 lib/kb/cache.rb
barkibu-kb-0.16.1 lib/kb/cache.rb