Ruby: Integer.times - how do I know what iteration I'm in?

Posted by Forkrul Assail on Stack Overflow See other posts from Stack Overflow or by Forkrul Assail
Published on 2010-04-05T15:41:02Z Indexed on 2010/04/05 15:43 UTC
Read the original article Hit count: 264

Filed under:
|

Let's say I have

some_value = 23

I use the integer and the .times to loop.

Inside the iteration, is there an easy way, without keeping a counter, to see what iteration the loop is currently in?

© Stack Overflow or respective owner

Related posts about ruby

Related posts about looping