Ruby 2.6.0 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > Enumerator::ArithmeticSequenceクラス > size
size -> Integer | nil
有限なら要素数を返します。そうでなければ nil を返します。