title: how does Enumerable#cycle work? (ruby)
body: <pre><code>looper = (0..3).cycle
  20.times { puts looper.next }
  </code></pre>
  
  <p>can I somehow find the next of 3? I mean if I can get <code>.next</code> of any particular element at any given time. Not just display loop that starts with the first element.</p>
  
  <h2><strong>UPDATE</strong></h2>
  
  <p>Of course I went though ruby <a href="http://ruby-doc.org/core-1.9/classes/Enumerable.html#M003054" rel="nofollow noreferrer">doc</a> before posting my question. But I did not find answer there ...</p>
  
  <h2><strong>UPDATE2</strong></h2>
  
  <p><strong>input</strong></p>
  
  <p><code>looper = (0..max_cycle).cycle</code></p>
  
  <p><code>max_cycle</code> = variable that can be different every time the script runs</p>
  
  <p><code>looper</code> = variable that is always from interval (0..max_cycle) but the current value when the script starts could be any. It is based on <code>Time.now.hour</code></p>
  
  <p><strong>output</strong></p>
  
  <p>I want to know <code>.next</code> value of <code>looper</code> at any time during the running time of the script</p>