Method: IPAddress::IPv6#size
- Defined in:
- lib/ipaddress/ipv6.rb
#size ⇒ Object
Returns the number of IP addresses included in the network. It also counts the network address and the broadcast address.
ip6 = IPAddress("2001:db8::8:800:200c:417a/64")
ip6.size
#=> 18446744073709551616
368 369 370 |
# File 'lib/ipaddress/ipv6.rb', line 368 def size 2 ** @prefix.host_prefix end |