Class: Nmap::Address

Inherits:
Struct
  • Object
show all
Defined in:
lib/nmap/address.rb

Overview

Represents an IP or MAC address and Vendor name.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, addr, vendor = nil) ⇒ Address

Initializes the address.

Parameters:

  • type (Symbol)

    The type of address.

  • addr (String)

    The address.

  • vendor (String, nil) (defaults to: nil)

    The optional vendor.



19
20
21
# File 'lib/nmap/address.rb', line 19

def initialize(type,addr,vendor=nil)
  super(type,addr,vendor)
end

Instance Attribute Details

#addrObject

Returns the value of attribute addr

Returns:

  • (Object)

    the current value of addr



5
6
7
# File 'lib/nmap/address.rb', line 5

def addr
  @addr
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



5
6
7
# File 'lib/nmap/address.rb', line 5

def type
  @type
end

#vendorObject

Returns the value of attribute vendor

Returns:

  • (Object)

    the current value of vendor



5
6
7
# File 'lib/nmap/address.rb', line 5

def vendor
  @vendor
end

Instance Method Details

#to_sString

Converts the address to a String.

Returns:

  • (String)

    The address.



29
30
31
# File 'lib/nmap/address.rb', line 29

def to_s
  self.addr.to_s
end