Skip to content
Snippets Groups Projects
Commit eb017ad7 authored by Juho Mäkinen's avatar Juho Mäkinen Committed by Romain Tartière
Browse files

Add allocate() method

The allocate() method allows to use an IPAddress::IPv4 or ::IPv6 object
to allocate individual host addresses so that the IPAddress object
tracks the state of which address was previously allocated.

Example:

  ip = IPAddress("10.0.0.0/24")
  ip.allocate
    #=> "10.0.0.1/24"
  ip.allocate
    #=> "10.0.0.2/24"

There is support for both IPv4 and IPv6 with full test coverage.
parent 032e8247
Branches
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment