Method: IPAddress::IPv6#network

Defined in:
lib/ipaddress/ipv6.rb

#networkObject

Returns a new IPv6 object with the network number for the given IP.

ip = IPAddress "2001:db8:1:1:1:1:1:1/32" 

ip.network.to_string
  #=> "2001:db8::/32"


548
549
550
# File 'lib/ipaddress/ipv6.rb', line 548

def network
  self.class.parse_u128(network_u128, @prefix)
end