Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
ObjectSpace::WeakMap#values
map.values → new_array
weakmap.c
View on GitHub ↗
static VALUE
wmap_values(VALUE self)
{
struct weakmap *w;
TypedData_Get_Struct(self, struct weakmap, &rb_weakmap_type, w);
VALUE ary = rb_ary_new();
st_foreach(w->table, wmap_values_i, (st_data_t)ary);
return ary;
}
Returns a new Array containing all values in the map.