public Method

Array.indexes(...)

array.indexes( i1, i2, ... iN )    an_array
array.indices( i1, i2, ... iN )    an_array

Deprecated; use Array#values_at.

Source Code

/*
*  call-seq:
*     array.indexes( i1, i2, ... iN )   -> an_array
*     array.indices( i1, i2, ... iN )   -> an_array
*  
*  Deprecated; use <code>Array#values_at</code>.
*/

static VALUE
rb_ary_indexes(argc, argv, ary)
   int argc;
   VALUE *argv;
   VALUE ary;
{
   VALUE new_ary;
   long i;

   rb_warn("Array#%s is deprecated; use Array#values_at", rb_id2name(rb_frame_last_func()));
   new_ary = rb_ary_new2(argc);
   for (i=0; i<argc; i++) {
       rb_ary_push(new_ary, rb_ary_aref(1, argv+i, ary));
   }

   return new_ary;
}
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.