[DOC] Add docs for WeakMap#inspect

This commit is contained in:
Peter Zhu 2026-01-13 17:59:59 -05:00
parent b21edc1323
commit 068713964a
Notes: git 2026-01-14 22:09:08 +00:00

View File

@ -207,6 +207,17 @@ wmap_inspect_i(st_data_t k, st_data_t v, st_data_t data)
return ST_CONTINUE;
}
/* call-seq:
* inspect -> new_string
*
* Returns a new string containing the \WeakMap entries:
*
* m = ObjectSpace::WeakMap.new
* m["one"] = 1
* m["two"] = 2
* m.inspect
* # => "#<ObjectSpace::WeakMap:0x00007c457b2523e8: #<String:0x00007c457b2674f0> => 1, #<String:0x00007c457b27b8d8> => 2>"
*/
static VALUE
wmap_inspect(VALUE self)
{