Bug #1665 » doc_enum19.patch
enum.c (working copy) | ||
---|---|---|
/*
|
||
* call-seq:
|
||
* enum.to_a => array
|
||
* enum.entries => array
|
||
* enum.to_a(*args) => array
|
||
* enum.entries(*args) => array
|
||
*
|
||
* Returns an array containing the items in <i>enum</i>.
|
||
* The given <i>args</i>, if any, are passed to <code>each</code>.
|
||
*
|
||
* (1..7).to_a #=> [1, 2, 3, 4, 5, 6, 7]
|
||
* { 'a'=>1, 'b'=>2, 'c'=>3 }.to_a #=> [["a", 1], ["b", 2], ["c", 3]]
|
||
* s = StringIO.new("Hello world")
|
||
* s.to_a("l") #=> ["Hel", "l", "o worl", "d"]
|
||
*/
|
||
static VALUE
|
||
enum_to_a(int argc, VALUE *argv, VALUE obj)
|
||
{
|