Class: KnocKnoc::Host
- Inherits:
-
Object
- Object
- KnocKnoc::Host
- Defined in:
- lib/knoc-knoc/host.rb
Instance Attribute Summary collapse
-
#hostname ⇒ Object
readonly
@ip, @hostname, @mac = nil, nil, nil.
-
#ip ⇒ Object
readonly
@ip, @hostname, @mac = nil, nil, nil.
-
#mac ⇒ Object
readonly
@ip, @hostname, @mac = nil, nil, nil.
Instance Method Summary collapse
-
#initialize(address) ⇒ Host
constructor
A new instance of Host.
Constructor Details
#initialize(address) ⇒ Host
8 9 10 11 12 |
# File 'lib/knoc-knoc/host.rb', line 8 def initialize(address) @ip = address @hostname = get_hostname(address) @mac = get_mac(address) end |
Instance Attribute Details
#hostname ⇒ Object (readonly)
@ip, @hostname, @mac = nil, nil, nil
6 7 8 |
# File 'lib/knoc-knoc/host.rb', line 6 def hostname @hostname end |
#ip ⇒ Object (readonly)
@ip, @hostname, @mac = nil, nil, nil
6 7 8 |
# File 'lib/knoc-knoc/host.rb', line 6 def ip @ip end |
#mac ⇒ Object (readonly)
@ip, @hostname, @mac = nil, nil, nil
6 7 8 |
# File 'lib/knoc-knoc/host.rb', line 6 def mac @mac end |