instance method Integer#downto

downto(min) {|n| ... } -> self[permalink][rdoc][edit]
downto(min) -> Enumerator

self から min まで 1 ずつ減らしながらブロックを繰り返し実行します。 self < min であれば何もしません。

[PARAM] min:
数値
[RETURN]
self を返します。

5.downto(1) {|i| print i, " " } # => 5 4 3 2 1

[SEE_ALSO] Integer#upto, Numeric#step, Integer#times