Class: WebMock::HttpLibAdapters::HTTPClientAdapter

Inherits:
WebMock::HttpLibAdapter show all
Defined in:
lib/webmock/http_lib_adapters/httpclient_adapter.rb

Constant Summary collapse

OriginalHttpClient =
::HTTPClient

Class Method Summary collapse

Methods inherited from WebMock::HttpLibAdapter

adapter_for

Class Method Details

.disable!Object



21
22
23
24
# File 'lib/webmock/http_lib_adapters/httpclient_adapter.rb', line 21

def self.disable!
  Object.send(:remove_const, :HTTPClient)
  Object.send(:const_set, :HTTPClient, OriginalHttpClient)
end

.enable!Object



16
17
18
19
# File 'lib/webmock/http_lib_adapters/httpclient_adapter.rb', line 16

def self.enable!
  Object.send(:remove_const, :HTTPClient)
  Object.send(:const_set, :HTTPClient, WebMockHTTPClient)
end