Class IPAddress::Prefix128
In: lib/ipaddress/prefix.rb
Parent: Prefix

Methods

bits   host_prefix   new   to_u128  

Public Class methods

Creates a new prefix object for 128 bits IPv6 addresses

  prefix = IPAddress::Prefix128.new 64
    #=> 64

Public Instance methods

Transforms the prefix into a string of bits representing the netmask

  prefix = IPAddress::Prefix128.new 64

  prefix.bits
    #=> "1111111111111111111111111111111111111111111111111111111111111111"
        "0000000000000000000000000000000000000000000000000000000000000000"

Returns the length of the host portion of a netmask.

  prefix = Prefix128.new 96

  prefix.host_prefix
    #=> 32

Unsigned 128 bits decimal number representing the prefix

  prefix = IPAddress::Prefix128.new 64

  prefix.to_u128
    #=> 340282366920938463444927863358058659840

[Validate]