Class: KnocKnoc::Host

Inherits:
Object
  • Object
show all
Defined in:
lib/knoc-knoc/host.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#hostnameObject (readonly)

@ip, @hostname, @mac = nil, nil, nil



6
7
8
# File 'lib/knoc-knoc/host.rb', line 6

def hostname
  @hostname
end

#ipObject (readonly)

@ip, @hostname, @mac = nil, nil, nil



6
7
8
# File 'lib/knoc-knoc/host.rb', line 6

def ip
  @ip
end

#macObject (readonly)

@ip, @hostname, @mac = nil, nil, nil



6
7
8
# File 'lib/knoc-knoc/host.rb', line 6

def mac
  @mac
end