Class: IPAddr

Inherits:
Object
  • Object
show all
Defined in:
lib/ext/ipaddr.rb

Class Method Summary collapse

Class Method Details

.inet_ntoa(addr) ⇒ Object

This is an extension to the base IPAddr that adds the ability to convert an IP Address from it’s network form to a string in the standard dotted decimal format



27
28
29
# File 'lib/ext/ipaddr.rb', line 27

def self.inet_ntoa(addr)
  [addr].pack("N").unpack("C*").join "."
end