2013-03-05 Enumerable#cycleで無限に循環するイテレータを作る ruby 周期の異なるループを混ぜ込むのに便利。 iterator = ("a".."z").cycle 1.upto(100) do |i| puts "#{i}: #{iterator.next}" end