to_a(...)
public
Returns an array containing the items in enum.
(1..7).to_a
{ 'a'=>1, 'b'=>2, 'c'=>3 }.to_a
Show source
/*
* call-seq:
* enum.to_a => array
* enum.entries => array
*
* Returns an array containing the items in <i>enum</i>.
*
* (1..7).to_a
* { 'a'=>1, 'b'=>2, 'c'=>3 }.to_a
*/
static VALUE
enum_to_a(argc, argv, obj)
int argc;
VALUE *argv;
VALUE obj;
{
VALUE ary = rb_ary_new();
rb_block_call(obj, id_each, argc, argv, collect_all, ary);
return ary;
}