Class: AsyncConnectionAdapter::AsyncHTTPConnection
- Inherits:
-
EventMachine::HttpConnection
- Object
- EventMachine::HttpConnection
- AsyncConnectionAdapter::AsyncHTTPConnection
- Defined in:
- lib/resthome/httparty/async_connection_adapter.rb
Overview
add a request method to EventMachine::HttpConnection to simulate how Net::HTTP works
Instance Method Summary collapse
Instance Method Details
#request(raw_request) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/resthome/httparty/async_connection_adapter.rb', line 19 def request(raw_request) case raw_request when Net::HTTP::Get AsyncHTTPResponse.new self.get when Net::HTTP::Post AsyncHTTPResponse.new self.post when Net::HTTP::Put AsyncHTTPResponse.new self.put when Net::HTTP::Delete AsyncHTTPResponse.new self.delete when Net::HTTP::Head AsyncHTTPResponse.new self.head else raise "unknown request type #{raw_request}" end end |