On Tue, Jan 28, 2014 at 12:15 PM, Stu P. D'naim <lists / ruby-forum.com> wrote:

> I see in docs you can also do similar behind Array.new, very useful
> stuff, thanks again to everyone !

But there it behaves differently: the Array will be created and filled
with values obtained from the block:

Ruby version 1.9.3
irb(main):001:0> a = Array.new(5) {|i| "item %p" % i}
=> ["item 0", "item 1", "item 2", "item 3", "item 4"]

Cheers

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/