summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
authorzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-20 15:49:42 +0000
committerzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-20 15:49:42 +0000
commitb8d053030edfff3d5c282eaee47b2789813db07f (patch)
treefe606cba5bd4f447adfbda139a46c897e79bf3cd /enum.c
parent1b3adaefd9e16494457745499c6ecb639493be57 (diff)
* enum.c: [DOC] Enumerable#to_a accepts arguments [GH-388]
Patch by @kachick https://github.com/ruby/ruby/pull/388 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/enum.c b/enum.c
index e977dedd76..df3c5636ec 100644
--- a/enum.c
+++ b/enum.c
@@ -487,13 +487,16 @@ enum_flat_map(VALUE obj)
/*
* 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>.
*
* (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]]
+ *
+ * require 'prime'
+ * Prime.entries 10 #=> [2, 3, 5, 7]
*/
static VALUE
enum_to_a(int argc, VALUE *argv, VALUE obj)