mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
1b3adaefd9
commit
b8d053030e
2 changed files with 10 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Sat Sep 21 00:49:16 2013 Zachary Scott <e@zzak.io>
|
||||||
|
|
||||||
|
* enum.c: [DOC] Enumerable#to_a accepts arguments [GH-388]
|
||||||
|
Patch by @kachick https://github.com/ruby/ruby/pull/388
|
||||||
|
|
||||||
Sat Sep 21 00:47:44 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sat Sep 21 00:47:44 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* string.c (rb_str_conv_enc_opts): make sure to scan coderange to get
|
* string.c (rb_str_conv_enc_opts): make sure to scan coderange to get
|
||||||
|
|
7
enum.c
7
enum.c
|
@ -487,13 +487,16 @@ enum_flat_map(VALUE obj)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* enum.to_a -> array
|
* enum.to_a(*args) -> array
|
||||||
* enum.entries -> array
|
* enum.entries(*args) -> array
|
||||||
*
|
*
|
||||||
* Returns an array containing the items in <i>enum</i>.
|
* Returns an array containing the items in <i>enum</i>.
|
||||||
*
|
*
|
||||||
* (1..7).to_a #=> [1, 2, 3, 4, 5, 6, 7]
|
* (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]]
|
* { '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
|
static VALUE
|
||||||
enum_to_a(int argc, VALUE *argv, VALUE obj)
|
enum_to_a(int argc, VALUE *argv, VALUE obj)
|
||||||
|
|
Loading…
Add table
Reference in a new issue