| 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 178
178: def initialize(hash={})
179: @hash = hash
180: end
# File lib/rack/cache/metastore.rb, line 194
194: def purge(key)
195: @hash.delete(key)
196: nil
197: end
# File lib/rack/cache/metastore.rb, line 182
182: def read(key)
183: if data = @hash[key]
184: Marshal.load(data)
185: else
186: []
187: end
188: end