Class: Comana::HostInspector::Ping

Inherits:
Object
  • Object
show all
Defined in:
lib/comana/hostinspector/ping.rb

Constant Summary collapse

PING_MIN_INTERVAL =
1

Instance Method Summary collapse

Constructor Details

#initialize(hostname) ⇒ Ping

Returns a new instance of Ping.



11
12
13
14
# File 'lib/comana/hostinspector/ping.rb', line 11

def initialize(hostname)
  @hostname = hostname
  @alive = ping
end

Instance Method Details

#alive?Boolean

Return true if ping respond from the host. Return false if no ping respond from the host.

Returns:

  • (Boolean)


18
19
20
# File 'lib/comana/hostinspector/ping.rb', line 18

def alive?
  @alive
end