Concrete MetaStore implementation that uses a simple Hash to store request/response pairs on the heap.
# File lib/rack/cache/metastore.rb, line 173 def initialize(hash={}) @hash = hash end
# File lib/rack/cache/metastore.rb, line 196 def self.resolve(uri) new end
# File lib/rack/cache/metastore.rb, line 187 def purge(key) @hash.delete(key) nil end
# File lib/rack/cache/metastore.rb, line 177 def read(key) @hash.fetch(key, []).collect do |req,res| [req.dup, res.dup] end end
# File lib/rack/cache/metastore.rb, line 192 def to_hash @hash end
# File lib/rack/cache/metastore.rb, line 183 def write(key, entries) @hash[key] = entries end