From 068713964a3949c9221da291e5e5f5167e692239 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Tue, 13 Jan 2026 17:59:59 -0500 Subject: [PATCH] [DOC] Add docs for WeakMap#inspect --- weakmap.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/weakmap.c b/weakmap.c index b027604f5e..80ef29b4cc 100644 --- a/weakmap.c +++ b/weakmap.c @@ -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 + * # => "# => 1, # => 2>" + */ static VALUE wmap_inspect(VALUE self) {