public Method

Array.inspect

array.inspect   string

Create a printable version of array.

Source Code

/*
*  call-seq:
*     array.inspect  -> string
*
*  Create a printable version of <i>array</i>.
*/

static VALUE
rb_ary_inspect(ary)
   VALUE ary;
{
   if (RARRAY(ary)->len == 0) return rb_str_new2("[]");
   if (rb_inspecting_p(ary)) return rb_str_new2("[...]");
   return rb_protect_inspect(inspect_ary, ary, 0);
}
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.