Method: Weak::Map#fetch
- Defined in:
- lib/weak/map.rb
#fetch(key, default = UNDEFINED) {|key| ... } ⇒ Object
Note:
Weak::Map does not test member equality with == or eql?.
Instead, it always checks strict object equality, so that, e.g.,
different String keys are not considered equal, even if they may
contain the same content.
Returns a value from the hash for the given key. If the key can't be
found, there are several options: With no other arguments, it will raise
a KeyError exception; if default is given, then that value will be
returned; if the optional code block is specified, then it will be
called and its result returned.
|
|
# File 'lib/weak/map.rb', line 250
|