to_a()
public
Returns self. If called on a subclass of Array, converts the receiver to an Array object.
Show source
/*
* call-seq:
* array.to_a -> array
*
* Returns _self_. If called on a subclass of Array, converts
* the receiver to an Array object.
*/
static VALUE
rb_ary_to_a(ary)
VALUE ary;
{
if (rb_obj_class(ary) != rb_cArray) {
VALUE dup = rb_ary_new2(RARRAY(ary)->len);
rb_ary_replace(dup, ary);
return dup;
}
return ary;
}