class Chimp::ChimpDaemon::GenericServlet

GenericServlet – servlet superclass

Public Instance Methods

get_id(req) click to toggle source
# File lib/right_chimp/daemon/chimp_daemon.rb, line 286
def get_id(req)
  uri_parts = req.request_uri.path.split('/')
  id = uri_parts[-2]
  return id
end
get_job_uuid(req) click to toggle source
# File lib/right_chimp/daemon/chimp_daemon.rb, line 292
def get_job_uuid(req)
  string = req.body.scan(/job_uuid: .{6}/).last
  job_uuid = string.scan(/ (.{6})/).last.last
  return job_uuid
end
get_payload(req) click to toggle source

Get the body of the request– assume YAML

# File lib/right_chimp/daemon/chimp_daemon.rb, line 300
def get_payload(req)
  begin
    return YAML::load(req.body)
  rescue StandardError => ex
    return nil
  end
end
get_verb(req) click to toggle source

get_verb get_id get_payload

# File lib/right_chimp/daemon/chimp_daemon.rb, line 282
def get_verb(req)
  r = req.request_uri.path.split('/')[2]
end