Class: ARPScan::Host
- Inherits:
-
Object
- Object
- ARPScan::Host
- Defined in:
- lib/arp_scan/host.rb
Overview
Abstracts replying hosts from the arp-scan output.
Instance Attribute Summary collapse
-
#ip_addr ⇒ Object
readonly
The IP address of the host.
-
#mac ⇒ Object
readonly
The MAC address of the host.
-
#oui ⇒ Object
readonly
OUI information about the host.
Instance Method Summary collapse
-
#initialize(ip_addr, mac, oui) ⇒ Host
constructor
Create a new hsot.
-
#to_array ⇒ Object
Returns an array representation of the Host object.
-
#to_hash ⇒ Object
Returns a hash representation of the Host object.
Constructor Details
#initialize(ip_addr, mac, oui) ⇒ Host
Create a new hsot. IP address, MAC address and OUI information are expected.
22 23 24 25 26 |
# File 'lib/arp_scan/host.rb', line 22 def initialize(ip_addr, mac, oui) @ip_addr = ip_addr @mac = mac @oui = oui end |
Instance Attribute Details
#ip_addr ⇒ Object (readonly)
The IP address of the host.
9 10 11 |
# File 'lib/arp_scan/host.rb', line 9 def ip_addr @ip_addr end |
#mac ⇒ Object (readonly)
The MAC address of the host.
13 14 15 |
# File 'lib/arp_scan/host.rb', line 13 def mac @mac end |
#oui ⇒ Object (readonly)
OUI information about the host.
17 18 19 |
# File 'lib/arp_scan/host.rb', line 17 def oui @oui end |
Instance Method Details
#to_array ⇒ Object
Returns an array representation of the Host object.
38 39 40 41 42 |
# File 'lib/arp_scan/host.rb', line 38 def to_array [@ip_addr, @mac, @oui] end |
#to_hash ⇒ Object
Returns a hash representation of the Host object.
30 31 32 33 34 |
# File 'lib/arp_scan/host.rb', line 30 def to_hash { ip_addr: @ip_addr, mac: @mac, oui: @oui } end |