mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* array.c: [DOC] Clarify default argument for Array.new.
By @Elffers [Fixes GH-610] [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
923b43fb9c
commit
f1d6b82981
2 changed files with 9 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
|||
Sun May 25 06:29:39 2014 Zachary Scott <e@zzak.io>
|
||||
|
||||
* array.c: [DOC] Clarify default argument for Array.new.
|
||||
By @Elffers [Fixes GH-610]
|
||||
|
||||
Sat May 24 22:37:20 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
|
||||
|
||||
* array.c: [DOC] Add more documents to shuffle! and shuffle.
|
||||
|
|
8
array.c
8
array.c
|
@ -671,16 +671,16 @@ rb_ary_s_try_convert(VALUE dummy, VALUE ary)
|
|||
|
||||
/*
|
||||
* call-seq:
|
||||
* Array.new(size=0, obj=nil)
|
||||
* Array.new(size=0, default=nil)
|
||||
* Array.new(array)
|
||||
* Array.new(size) {|index| block }
|
||||
*
|
||||
* Returns a new array.
|
||||
*
|
||||
* In the first form, if no arguments are sent, the new array will be empty.
|
||||
* When a +size+ and an optional +obj+ are sent, an array is created with
|
||||
* +size+ copies of +obj+. Take notice that all elements will reference the
|
||||
* same object +obj+.
|
||||
* When a +size+ and an optional +default+ are sent, an array is created with
|
||||
* +size+ copies of +default+. Take notice that all elements will reference the
|
||||
* same object +default+.
|
||||
*
|
||||
* The second form creates a copy of the array passed as a parameter (the
|
||||
* array is generated by calling to_ary on the parameter).
|
||||
|
|
Loading…
Add table
Reference in a new issue