Class: Nmap::XML::Address

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

Overview

Represents an IP or MAC address and Vendor name.

Since:

  • 1.0.0

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.

Since:

  • 1.0.0



24
25
26
# File 'lib/nmap/xml/address.rb', line 24

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



10
11
12
# File 'lib/nmap/xml/address.rb', line 10

def addr
  @addr
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



10
11
12
# File 'lib/nmap/xml/address.rb', line 10

def type
  @type
end

#vendorObject

Returns the value of attribute vendor

Returns:

  • (Object)

    the current value of vendor



10
11
12
# File 'lib/nmap/xml/address.rb', line 10

def vendor
  @vendor
end

Instance Method Details

#to_sString

Converts the address to a String.

Returns:

  • (String)

    The address.

Since:

  • 1.0.0



34
35
36
# File 'lib/nmap/xml/address.rb', line 34

def to_s
  self.addr.to_s
end