Class: Server
- Inherits:
-
EM::Connection
- Object
- EM::Connection
- Server
- Includes:
- EM::HttpServer
- Defined in:
- lib/cogbot/server.rb
Instance Method Summary collapse
-
#initialize(bot) ⇒ Server
constructor
A new instance of Server.
- #post_init ⇒ Object
- #process_http_request ⇒ Object
Constructor Details
#initialize(bot) ⇒ Server
Returns a new instance of Server.
4 5 6 |
# File 'lib/cogbot/server.rb', line 4 def initialize(bot) @bot = bot end |
Instance Method Details
#post_init ⇒ Object
8 9 10 11 |
# File 'lib/cogbot/server.rb', line 8 def post_init super no_environment_strings end |
#process_http_request ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/cogbot/server.rb', line 13 def process_http_request if @http_request_method == "POST" @bot.handlers.dispatch(:api_callback, nil, @http_post_content) end response = EM::DelegatedHttpResponse.new(self) response.status = 200 response.send_response end |