Method: IPAddress::IPv4#b?

Defined in:
lib/ipaddress/ipv4.rb

#b?Boolean

Checks whether the ip address belongs to a RFC 791 CLASS B network, no matter what the subnet mask is.

Example:

ip = IPAddress("172.16.10.1/24")

ip.b?
  #=> true

Returns:

  • (Boolean)


874
875
876
# File 'lib/ipaddress/ipv4.rb', line 874

def b?
  CLASSFUL.key(16) === bits
end