instance method
Array#to_s
() -> ::String
to_s → new_string
array.c
View on GitHub ↗
static VALUE
rb_ary_inspect(VALUE ary)
{
if (RARRAY_LEN(ary) == 0) return rb_usascii_str_new2("[]");
return rb_exec_recursive(inspect_ary, ary, 0);
}
Alias of #inspect
Returns the new string formed by calling method inspect on each array element:
Example
a = [:foo, 'bar', 2] a.inspect # => "[:foo, \"bar\", 2]"
Related: see Methods for Converting.