Rack::Cache::MetaStore::Heap

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 178
178:       def initialize(hash={})
179:         @hash = hash
180:       end
resolve(uri) click to toggle source
     # File lib/rack/cache/metastore.rb, line 203
203:       def self.resolve(uri)
204:         new
205:       end

Public Instance Methods

purge(key) click to toggle source
     # File lib/rack/cache/metastore.rb, line 194
194:       def purge(key)
195:         @hash.delete(key)
196:         nil
197:       end
read(key) click to toggle source
     # 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
to_hash() click to toggle source
     # File lib/rack/cache/metastore.rb, line 199
199:       def to_hash
200:         @hash
201:       end
write(key, entries) click to toggle source
     # File lib/rack/cache/metastore.rb, line 190
190:       def write(key, entries)
191:         @hash[key] = Marshal.dump(entries)
192:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.