module Scrivito module Cache class RamStore include Chainable attr_reader :internal_store, :next_store, :cache_prefix def initialize(options = {}) @internal_store = {} @next_store, @cache_prefix = *options.values_at(:next_store, :cache_prefix) end delegate :clear, to: :internal_store private def internal_read(key) internal_store[key] end def internal_write(key, value, expires_in = nil) internal_store[key] = value end def transform_key(key) cache_prefix ? "#{cache_prefix}/#{key}" : key end end end end