Method: IPAddress::IPv4#prefix

Defined in:
lib/ipaddress/ipv4.rb

#prefixObject

Returns the prefix portion of the IPv4 object as a IPAddress::Prefix32 object

ip = IPAddress("172.16.100.4/22")

ip.prefix
  #=> 22

ip.prefix.class
  #=> IPAddress::Prefix32


121
122
123
# File 'lib/ipaddress/ipv4.rb', line 121

def prefix
  @prefix
end