Class: ServerStatusApp

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/server_status/app.rb

Defined Under Namespace

Classes: Status

Class Method Summary collapse

Class Method Details

.check(server) ⇒ Object



6
7
8
9
10
11
# File 'lib/server_status/app.rb', line 6

def check server
  server_config = ServerStatusConfig.servers[server.to_sym]
  client = ServerStatusClient.new server_config
  status_code = client.request.to_s
  Status.new server, server_config[:description.to_s], status_code, client.is_port_open?
end