class Rufus::Lru::Hash
def initialize(maxsize, opts={})
value as argument) each time a removal occurs
* A lambda/proc can be set, it's thus called (and passed the removed
that has to be called on the value just removed
* A symbol can be used to point to a method like :clear or :destroy
* False is the default, values are removed, nothing special happens.
accepts false, a symbol or a lambda.
* :on_removal
defaults to true
* :auto_squeeze
Options:
Initializes a LruHash with a given maxsize.
def initialize(maxsize, opts={}) fail ArgumentError.new("maxsize must be >= 0") if maxsize < 0 super() @maxsize = maxsize @lru_keys = [] @auto_squeeze = opts.has_key?(:auto_squeeze) ? opts[:auto_squeeze] : true @on_removal = opts[:on_removal] end