Sha256: 4da2c77422dc66a23858acd2f5a88e4166ef88e45970f8de6de9e6e114dd44da
Contents?: true
Size: 654 Bytes
Versions: 11
Compression:
Stored size: 654 Bytes
Contents
# eventmachine engine for serving as a webhook destination class Server < EM::Connection include EM::HttpServer def initialize(bot) @bot = bot end def post_init super no_environment_strings end def process_http_request if @http_request_method == "POST" pluginlist = @bot.plugins.map { |e| e.class.name.split('::').last.downcase } query = @http_request_uri[1..-1] if pluginlist.include? query @bot.handlers.dispatch("http_#{query}".to_sym, nil, @http_post_content) end end response = EM::DelegatedHttpResponse.new(self) response.status = 200 response.send_response end end
Version data entries
11 entries across 11 versions & 1 rubygems