Rack::Cache::MetaStore::MEM

Concrete MetaStore implementation that uses a simple Hash to store request/response pairs on the heap.

Public Class Methods

new(hash={}) click to toggle source
# File lib/rack/cache/metastore.rb, line 174
def initialize(hash={})
  @hash = hash
end
resolve(uri) click to toggle source
# File lib/rack/cache/metastore.rb, line 199
def self.resolve(uri)
  new
end

Public Instance Methods

purge(key) click to toggle source
# File lib/rack/cache/metastore.rb, line 190
def purge(key)
  @hash.delete(key)
  nil
end
read(key) click to toggle source
# File lib/rack/cache/metastore.rb, line 178
def read(key)
  if data = @hash[key]
    Marshal.load(data)
  else
    []
  end
end
to_hash() click to toggle source
# File lib/rack/cache/metastore.rb, line 195
def to_hash
  @hash
end
write(key, entries) click to toggle source
# File lib/rack/cache/metastore.rb, line 186
def write(key, entries)
  @hash[key] = Marshal.dump(entries)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.