mirror of
https://github.com/ruby/ruby.git
synced 2026-10-28 16:36:20 +08:00
[DOC] Update Set#inspect documentation
This commit is contained in:
1 parent
73a6e69de1
commit
40c2f61195
1 file changed
+4
-8
Notes:
git
2026-06-28 18:01:17 +00:00
Merged: https://github.com/ruby/ruby/pull/17541 Merged-By: jeremyevans <code@jeremyevans.net>
@@ -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].
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user