summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-25 18:55:45 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-25 18:55:45 +0000
commit64cd400a3c99acd628ed96273710b7493af6625a (patch)
tree4226e7e6a43f14a748cbec77e04ee756a12751b0 /array.c
parent03ab27a83e1403bf0161965446f7548cd107ff1b (diff)
merge revision(s) 58037: [Backport #10944]
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/branches/ruby_2_2@58129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/array.c b/array.c
index 1ae14edf3a..7ced6578a4 100644
--- a/array.c
+++ b/array.c
@@ -5486,7 +5486,8 @@ rb_ary_any_p(VALUE ary)
* This method is safe to use with mutable objects such as hashes, strings or
* 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:
*