method
downto
v2_5_5 -
Show latest stable
- Class:
Integer
downto(p1)public
Iterates the given block, passing in 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, ".. " } puts "Liftoff!" #=> "5.. 4.. 3.. 2.. 1.. Liftoff!"