Class: PacketGen::Header::IP::ArrayOfAddr

Inherits:
Types::Array show all
Defined in:
lib/packetgen/header/ip/option.rb

Overview

Class to handle series of IP addresses

Author:

  • Sylvain Daubert

Constant Summary

Constants inherited from Types::Array

Types::Array::HUMAN_SEPARATOR

Instance Method Summary collapse

Methods inherited from Types::Array

#<<, #==, #[], #clear, #clear!, #delete, #delete_at, #each, #empty?, #first, #force_binary, #initialize, #initialize_copy, #last, #read, set_of, #size, #sz, #to_a, #to_human, #to_s

Constructor Details

This class inherits a constructor from PacketGen::Types::Array

Instance Method Details

#push(addr) ⇒ self

Push a IP address to the array

Parameters:

  • addr (String, Addr)

Returns:

  • (self)

    array << ‘192.168.1.12’



20
21
22
23
# File 'lib/packetgen/header/ip/option.rb', line 20

def push(addr)
  addr = addr.is_a?(Addr) ? addr : Addr.new.from_human(addr)
  super(addr)
end