Method: Weak::Map::WeakKeys#keys
- Defined in:
- lib/weak/map/weak_keys.rb
#keys ⇒ Array
Note:
In contrast to a Hash
, Weak::Map
s do not necessarily retain
insertion order.
Returns an Array
containing all keys of the map for which we
have a valid value. Keys with garbage-collected values are excluded.
111 112 113 |
# File 'lib/weak/map/weak_keys.rb', line 111 def keys @map.keys.delete_if { |key| missing?(@map[key]) } end |