Class: WebMock::HttpLibAdapters::NetHttp2Adapter

Inherits:
WebMock::HttpLibAdapter
  • Object
show all
Defined in:
lib/faraday/net_http2/webmock_adapter.rb

Constant Summary collapse

OriginalNetHttp2Client =
::NetHttp2::Client

Class Method Summary collapse

Class Method Details

.disable!Object



42
43
44
45
# File 'lib/faraday/net_http2/webmock_adapter.rb', line 42

def self.disable!
  ::NetHttp2.send(:remove_const, :Client)
  ::NetHttp2.send(:const_set, :Client, OriginalNetHttp2Client)
end

.enable!Object



37
38
39
40
# File 'lib/faraday/net_http2/webmock_adapter.rb', line 37

def self.enable!
  ::NetHttp2.send(:remove_const, :Client)
  ::NetHttp2.send(:const_set, :Client, WebMockNetHttp2Client)
end