Class: ProconBypassMan::WebConnectivityChecker

Inherits:
Object
  • Object
show all
Defined in:
lib/procon_bypass_man/support/web_connectivity_checker.rb

Instance Method Summary collapse

Constructor Details

#initialize(url, ws_url) ⇒ WebConnectivityChecker

Returns a new instance of WebConnectivityChecker.

Parameters:

  • url (String, NilClass)
  • ws_url (String, NilClass)


4
5
6
7
# File 'lib/procon_bypass_man/support/web_connectivity_checker.rb', line 4

def initialize(url, ws_url)
  @url = url
  @ws_url = ws_url
end

Instance Method Details

#to_sString

Returns:

  • (String)


10
11
12
13
14
15
16
17
18
19
20
# File 'lib/procon_bypass_man/support/web_connectivity_checker.rb', line 10

def to_s
  if @url.nil?
    return "DISABLE"
  end

  if alive?
    return "ENABLE (#{@url}, #{@ws_url})"
  else
   return "UNREACHABLE (#{@url})"
  end
end