Class: Itiscold::WebServer::InfoServlet

Inherits:
TTYServlet
  • Object
show all
Defined in:
lib/itiscold.rb

Instance Method Summary collapse

Methods inherited from TTYServlet

#initialize

Constructor Details

This class inherits a constructor from Itiscold::WebServer::TTYServlet

Instance Method Details

#do_GET(request, response) ⇒ Object



383
384
385
386
387
388
389
390
# File 'lib/itiscold.rb', line 383

def do_GET request, response
  response.status = 200
  response['Content-Type'] = 'text/json'
  @mutex.synchronize do
    json = JSON.dump(@tty.device_info.to_h)
    response.body = json
  end
end