Ruby 2.2.0 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > NilClassクラス > to_i

instance method NilClass#to_i

to_i -> Integer[permalink][rdoc]

0 を返します。



nil.to_i   #=> 0