Class: Chimp::ChimpDaemon::AdminServlet

Inherits:
GenericServlet
  • Object
show all
Defined in:
lib/right_chimp/daemon/ChimpDaemon.rb

Overview

AdminServlet - admin functions

Instance Method Summary collapse

Methods inherited from GenericServlet

#get_id, #get_payload, #get_verb

Instance Method Details

#do_POST(req, resp) ⇒ Object

Raises:

  • (WEBrick::HTTPStatus::OK)


254
255
256
257
258
259
260
261
262
263
# File 'lib/right_chimp/daemon/ChimpDaemon.rb', line 254

def do_POST(req, resp)
  payload = self.get_payload(req)
  shutdown = payload['shutdown'] || false

  if shutdown == true
  	ChimpDaemon.instance.quit
  end

  raise WEBrick::HTTPStatus::OK
end