Method: IPAddr#inspect

Defined in:
lib/ipaddr.rb

#inspectObject

Returns a string containing a human-readable representation of the ipaddr. (“#<IPAddr: family:address/mask>”)



321
322
323
324
325
326
327
328
329
330
331
332
# File 'lib/ipaddr.rb', line 321

def inspect
  case @family
  when Socket::AF_INET
    af = "IPv4"
  when Socket::AF_INET6
    af = "IPv6"
  else
    raise "unsupported address family"
  end
  return sprintf("#<%s: %s:%s/%s>", self.class.name,
   af, _to_string(@addr), _to_string(@mask_addr))
end