2 lines
107 B
Ruby
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)
|