RosettaCodeData/Task/Multiple-distinct-objects/Ruby/multiple-distinct-objects-1.rb
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

2 lines
107 B
Ruby

[Foo.new] * n # here Foo.new can be any expression that returns a new object
Array.new(n, Foo.new)