instance method
Array#inspect
() -> ::String
inspect → 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);
}
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.
See also
#insert
#intersect?
#initialize_copy
#intersection
also in
4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0