method

each

v1_8_7_330 - Show latest stable - Class: Range
each()
public

Iterates over the elements rng, passing each in turn to the block. You can only iterate if the start object of the range supports the succ method (which means that you can’t iterate over ranges of Float objects).

(10..15).each do |n|
   print n, ' '
end

produces:

10 11 12 13 14 15