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



335
336
337
338
339
340
341
342
# File 'lib/itiscold.rb', line 335

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