Class Net::Ping::HTTP
In: lib/net/ping/http.rb
Parent: Ping

The Ping::HTTP class encapsulates methods for HTTP pings.

Methods

new   ping   ping?   pingecho  

External Aliases

follow_redirect -> follow_redirect?
host -> uri
host= -> uri=

Attributes

follow_redirect  [RW]  By default an http ping will follow a redirect and give you the result of the final URI. If this value is set to false, then it will not follow a redirect and will return false immediately on a redirect.
redirect_limit  [RW]  The maximum number of redirects allowed. The default is 5.
user_agent  [RW]  The user agent used for the HTTP request. The default is nil.

Public Class methods

Creates and returns a new Ping::HTTP object. The default port is the port associated with the URI. The default timeout is 5 seconds.

Public Instance methods

Looks for an HTTP response from the URI passed to the constructor. If the result is a kind of Net::HTTPSuccess then the ping was successful and true is returned. Otherwise, false is returned and the Ping::HTTP#exception method should contain a string indicating what went wrong.

If the HTTP#follow_redirect accessor is set to true (which it is by default) and a redirect occurs during the ping, then the HTTP#warning attribute is set to the redirect message, but the return result is still true. If it‘s set to false then a redirect response is considered a failed ping.

If no file or path is specified in the URI, then ’/’ is assumed.

ping?(host = @host)

Alias for ping

pingecho(host = @host)

Alias for ping

[Validate]