Class: Fixnum

Inherits:
Object show all
Defined in:
lib/has_ip_address/extensions.rb

Instance Method Summary collapse

Instance Method Details

#to_ipaddrObject



25
26
27
# File 'lib/has_ip_address/extensions.rb', line 25

def to_ipaddr
 [24, 16, 8, 0].collect {|b| (self >> b) & 255}.join('.').to_ipaddr
end