Method: Integer#times
- Defined in:
- numeric.c
#times {|i| ... } ⇒ Integer
Iterates block int times, passing in values from zero to int - 1.
5.times do |i|
print i, " "
end
produces:
0 1 2 3 4
2926 2927 2928 |
# File 'numeric.c', line 2926 static VALUE int_dotimes(num) VALUE num; |