method
downto
v2_2_9 -
Show latest stable
- Class:
Integer
downto(p1)public
Iterates the given block, passing decreasing values from int down to and including limit.
If no block is given, an Enumerator is returned instead.
5.downto(1) { |n| print n, ".. " } print " Liftoff!\n" #=> "5.. 4.. 3.. 2.. 1.. Liftoff!"