Method: Array#inspect
- Defined in:
- array.c
#inspect ⇒ Object #to_s ⇒ Object Also known as: to_s
Returns the new string formed by calling method #inspect on each array element:
a = [:foo, 'bar', 2]
a.inspect # => "[:foo, \"bar\", 2]"
Related: see Methods for Converting.
2999 3000 3001 3002 3003 3004 |
# File 'array.c', line 2999 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); } |