Class | LRUHash |
In: |
lib/hashery/lruhash.rb
|
Parent: | Object |
Hash with LRU expiry policy. There are at most max_size elements in a LRUHash. When adding more elements old elements are removed according to LRU policy.
github.com/rklemme/muppet-laboratories/blob/master/lib/lruhash.rb Copyright (c) 2010 Robert Klemme
FETCH | = | Proc.new {|k| raise KeyError, 'key not found'} | ||
Node | = | Struct.new :key, :value, :pred, :succ do def unlink | A single node in the doubly linked LRU list of nodes |
default | [RW] | |
default_proc | [RW] | |
max_size | [R] | |
release_proc | [RW] |