Ruby 1.9.0 リファレンスマニュアル > ライブラリ一覧 > library ipaddr > class IPAddr > to_i

instance method IPAddr#to_i

to_i -> Integer

整数に変換します。

例:

require "ipaddr"
p IPAddr.new("0.0.1.0").to_i   # => 256