franzejr / best-ruby

Ruby Tricks, Idiomatic Ruby, Refactoring and Best Practices
http://franzejr.github.io/best-ruby/
2.39k stars 219 forks source link

Show Fixnum#times provides the iteration count #62

Closed peterwilson closed 8 years ago

peterwilson commented 8 years ago

The for i in range example provides an iteration counter. The Fixnum#times example can do the same.

franzejr commented 8 years ago

Thanks, @Inanepenguin :)