Class: WebMock::HttpLibAdapters::AsyncHttpClientAdapter
- Inherits:
-
WebMock::HttpLibAdapter
- Object
- WebMock::HttpLibAdapter
- WebMock::HttpLibAdapters::AsyncHttpClientAdapter
- Defined in:
- lib/webmock/http_lib_adapters/async_http_client_adapter.rb
Constant Summary collapse
Class Method Summary collapse
- .disable! ⇒ Object
- .enable! ⇒ Object
-
.status_descriptions ⇒ Object
protocol-http1 0.40.0 removed Protocol::HTTP1::Reason in favour of Protocol::HTTP::Status.
Methods inherited from WebMock::HttpLibAdapter
Class Method Details
.disable! ⇒ Object
35 36 37 38 |
# File 'lib/webmock/http_lib_adapters/async_http_client_adapter.rb', line 35 def disable! Async::HTTP.send(:remove_const, :Client) Async::HTTP.send(:const_set, :Client, OriginalAsyncHttpClient) end |
.enable! ⇒ Object
30 31 32 33 |
# File 'lib/webmock/http_lib_adapters/async_http_client_adapter.rb', line 30 def enable! Async::HTTP.send(:remove_const, :Client) Async::HTTP.send(:const_set, :Client, Async::HTTP::WebMockClientWrapper) end |
.status_descriptions ⇒ Object
protocol-http1 0.40.0 removed Protocol::HTTP1::Reason in favour of Protocol::HTTP::Status. Resolved on first use, rather than at load, so it does not depend on which of the two is required by then.
22 23 24 25 26 27 28 |
# File 'lib/webmock/http_lib_adapters/async_http_client_adapter.rb', line 22 def status_descriptions @status_descriptions ||= if defined?(::Protocol::HTTP1::Reason) ::Protocol::HTTP1::Reason::DESCRIPTIONS else ::Protocol::HTTP::Status::DESCRIPTIONS end end |