1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

docs for creating arrays

* array.c: [DOC] add example for Array.new with block and index.
  Reported by Don Cruickshank.  [ruby-core:68442] [Bug #10944]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
stomar 2017-03-20 20:30:25 +00:00
parent 719262eeda
commit 56abb1cdd8

View file

@ -5927,6 +5927,7 @@ rb_ary_sum(int argc, VALUE *argv, VALUE ary)
* other arrays: * other arrays:
* *
* Array.new(4) { Hash.new } #=> [{}, {}, {}, {}] * Array.new(4) { Hash.new } #=> [{}, {}, {}, {}]
* Array.new(4) {|i| i.to_s } #=> ["0", "1", "2", "3"]
* *
* This is also a quick way to build up multi-dimensional arrays: * This is also a quick way to build up multi-dimensional arrays:
* *