From: Peter Zotov Date: 2011-02-24T07:00:01+09:00 Subject: Re: a, b = Array.new(2).map!{|x| data.dup} On Thu, 24 Feb 2011 06:46:15 +0900 Stefan Salewski wrote: > I think I can replace this code > > @scr = @output.dup > @png = @output.dup > @pdf = @output.dup > @svg = @output.dup > @ps = @output.dup > > with this equivalent: > > @scr, @png, @pdf, @svg, @ps = Array.new(5).map!{|x| @output.dup} > > Is there a nicer variant available? @scr, @png, @pdf, @svg, @ps = 5.times.collect { @output.dup } -- WBR, Peter Zotov