From 40c2f61195ec661dedb214c337e11040c7a4dcd5 Mon Sep 17 00:00:00 2001 From: Burdette Lamar Date: Sun, 28 Jun 2026 13:00:48 -0500 Subject: [PATCH] [DOC] Update Set#inspect documentation --- set.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/set.c b/set.c index 4bea6a2d802..b06240f8d45 100644 --- a/set.c +++ b/set.c @@ -621,16 +621,12 @@ set_inspect(VALUE set, VALUE dummy, int recur) /* * call-seq: - * inspect -> new_string + * inspect -> string * - * Returns a new string containing the set entries: + * Returns a string representation of +self+: * - * s = Set.new - * s.inspect # => "Set[]" - * s.add(1) - * s.inspect # => "Set[1]" - * s.add(2) - * s.inspect # => "Set[1, 2]" + * Set[*%w[foo bar], {foo: 0, bar: 1}].inspect + * # => "Set[\"foo\", \"bar\", {foo: 0, bar: 1}]" * * Related: see {Methods for Converting}[rdoc-ref:Set@Methods+for+Converting]. */