class Rack::Cache::MetaStore::MEM
Concrete MetaStore implementation that uses a simple Hash to store request/response pairs on the heap.
Public Class Methods
Source
# File lib/rack/cache/meta_store.rb, line 200 def initialize(hash={}, options = {}) @hash = hash @options = options end
Source
# File lib/rack/cache/meta_store.rb, line 226 def self.resolve(uri, options = {}) new({}, options) end
Public Instance Methods
Source
# File lib/rack/cache/meta_store.rb, line 217 def purge(key) @hash.delete(key) nil end
Source
# File lib/rack/cache/meta_store.rb, line 205 def read(key) if data = @hash[key] Marshal.load(data) else [] end end
Source
# File lib/rack/cache/meta_store.rb, line 213 def write(key, entries, ttl = nil) @hash[key] = Marshal.dump(entries) end