Here's how you can use an enumerator to create an infinite array, from 
which you can print out finite chunks:

e = Enumerator.new do |y|
  (0..9).cycle do |x|
    y << x
  end
end


p e.take(15)

--output:--
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4]

-- 
Posted via http://www.ruby-forum.com/.