Class | Rack::Cache::MetaStore::Heap |
In: |
lib/rack/cache/metastore.rb
|
Parent: | MetaStore |
Concrete MetaStore implementation that uses a simple Hash to store request/response pairs on the heap.
# File lib/rack/cache/metastore.rb, line 174 174: def initialize(hash={}) 175: @hash = hash 176: end
# File lib/rack/cache/metastore.rb, line 190 190: def purge(key) 191: @hash.delete(key) 192: nil 193: end
# File lib/rack/cache/metastore.rb, line 178 178: def read(key) 179: if data = @hash[key] 180: Marshal.load(data) 181: else 182: [] 183: end 184: end