inspect()
public
Convert this range object to a printable form (using inspect to convert the start and end objects).
Show source
/*
* call-seq:
* rng.inspect => string
*
* Convert this range object to a printable form (using
* <code>inspect</code> to convert the start and end
* objects).
*/
static VALUE
range_inspect(range)
VALUE range;
{
VALUE str, str2;
str = rb_inspect(rb_ivar_get(range, id_beg));
str2 = rb_inspect(rb_ivar_get(range, id_end));
str = rb_str_dup(str);
rb_str_cat(str, "...", EXCL(range)?3:2);
rb_str_append(str, str2);
OBJ_INFECT(str, str2);
return str;
}