Class: PoolParty::Verifiers::Ping
- Inherits:
-
VerifierBase
- Object
- VerifierBase
- PoolParty::Verifiers::Ping
- Includes:
- Pinger
- Defined in:
- lib/poolparty/verification/verifiers/ping.rb
Overview
Ping
Open a TCPSocket and verify you can connect.
Example:
verify do
ping
ping(22)
end
Instance Attribute Summary collapse
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Attributes inherited from VerifierBase
Instance Method Summary collapse
-
#initialize(port = 80) ⇒ Ping
constructor
A new instance of Ping.
- #passing? ⇒ Boolean
- #to_s ⇒ Object
Methods included from Pinger
Methods inherited from VerifierBase
Constructor Details
#initialize(port = 80) ⇒ Ping
Returns a new instance of Ping.
20 21 22 |
# File 'lib/poolparty/verification/verifiers/ping.rb', line 20 def initialize(port=80) @port = port end |
Instance Attribute Details
#port ⇒ Object (readonly)
Returns the value of attribute port.
19 20 21 |
# File 'lib/poolparty/verification/verifiers/ping.rb', line 19 def port @port end |
Instance Method Details
#passing? ⇒ Boolean
23 24 25 |
# File 'lib/poolparty/verification/verifiers/ping.rb', line 23 def passing? ping_port(host, port, 3) end |
#to_s ⇒ Object
27 28 29 |
# File 'lib/poolparty/verification/verifiers/ping.rb', line 27 def to_s "<#{self.class.to_s} host:#{host} port:#{port}>" end |