From: Johannes Held Date: 2011-04-19T19:55:38+09:00 Subject: Re: How to use Enumerator::Generator in Ruby 1.9.2 On 19.04.2011 09:44, Robert Klemme wrote: > You can see an example in a recent posting: > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/381414 But this can be achieved easier, as e.g. (0..9).cycle already returns an Enumerator. ruby-1.9.2-p136 :002 > foo = (0..9).cycle => # ruby-1.9.2-p136 :003 > foo.next => 0 ruby-1.9.2-p136 :004 > foo.take 12 => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1] ruby-1.9.2-p136 :005 > foo.next => 1 ruby-1.9.2-p136 :006 > -- Gru�, Johannes