Class: ZombieCheck::Ping::NetPing

Inherits:
PingSender show all
Defined in:
lib/zombie_check/ping/ping_sender/net_ping.rb

Instance Attribute Summary

Attributes inherited from PingSender

#duration, #host

Instance Method Summary collapse

Constructor Details

#initialize(host) ⇒ NetPing

Returns a new instance of NetPing.



5
6
7
# File 'lib/zombie_check/ping/ping_sender/net_ping.rb', line 5

def initialize(host)
  super host
end

Instance Method Details

#sendObject



9
10
11
12
13
14
# File 'lib/zombie_check/ping/ping_sender/net_ping.rb', line 9

def send
  icmp = Net::Ping::ICMP.new(host)
  icmp.ping
  self.duration = icmp.duration
  self
end