Method: Weak::Map::AbstractStrongKeys#keys

Defined in:
lib/weak/map/abstract_strong_keys.rb

#keysArray

Note:

In contrast to a Hash, Weak::Maps 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.

Returns:

  • (Array)

    an Array containing all keys of the map for which we have a valid value. Keys with garbage-collected values are excluded.

See Also:



20
21
22
# File 'lib/weak/map/abstract_strong_keys.rb', line 20

def keys
  each_key.to_a
end