このマニュアルは既にメンテナンスが終了したバージョンの Ruby を対象としています。 最新版のマニュアルへ

Ruby 2.0.0 リファレンスマニュアル

instance method Integer#upto

upto(max) {|n| ... } -> Fixnum | Bignum[permalink][rdoc]
upto(max) -> Enumerator

self から max まで 1 ずつ増やしながら繰り返します。 self > max であれば何もしません。

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

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