Project

General

Profile

Bug #1665 » doc_enum19.patch

marcandre (Marc-Andre Lafortune), 06/20/2009 08:40 PM

View differences:

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)
{
(1-1/3)