Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Set#to_s
() -> ::String
to_s
set.c
View on GitHub ↗
static VALUE
set_i_inspect(VALUE set)
{
return rb_exec_recursive(set_inspect, set, 0);
}
Alias of #inspect
Returns a string representation of self:
Example
Set[*%w[foo bar], {foo: 0, bar: 1}].inspect # => "Set[\"foo\", \"bar\", {foo: 0, bar: 1}]"
Related: see Methods for Converting.