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.

Methods

new   purge   read   resolve   to_hash   write  

Public Class methods

[Source]

     # File lib/rack/cache/metastore.rb, line 173
173:       def initialize(hash={})
174:         @hash = hash
175:       end

[Source]

     # File lib/rack/cache/metastore.rb, line 196
196:       def self.resolve(uri)
197:         new
198:       end

Public Instance methods

[Source]

     # File lib/rack/cache/metastore.rb, line 187
187:       def purge(key)
188:         @hash.delete(key)
189:         nil
190:       end

[Source]

     # File lib/rack/cache/metastore.rb, line 177
177:       def read(key)
178:         @hash.fetch(key, []).collect do |req,res|
179:           [req.dup, res.dup]
180:         end
181:       end

[Source]

     # File lib/rack/cache/metastore.rb, line 192
192:       def to_hash
193:         @hash
194:       end

[Source]

     # File lib/rack/cache/metastore.rb, line 183
183:       def write(key, entries)
184:         @hash[key] = entries
185:       end

[Validate]