Class: RequestTagger::HttpMagic

Inherits:
Object
  • Object
show all
Defined in:
lib/request_tagger/http_magic.rb

Instance Method Summary collapse

Constructor Details

#initializeHttpMagic

Returns a new instance of HttpMagic.



12
13
14
15
# File 'lib/request_tagger/http_magic.rb', line 12

def initialize
  @original_net_http = original_net_http
  @magic_net_http = magic_net_http
end

Instance Method Details

#restoreObject



22
23
24
25
# File 'lib/request_tagger/http_magic.rb', line 22

def restore
  Net.send(:remove_const, :HTTP)
  Net.send(:const_set, :HTTP, @original_net_http)
end

#wrapObject



17
18
19
20
# File 'lib/request_tagger/http_magic.rb', line 17

def wrap
  Net.send(:remove_const, :HTTP)
  Net.send(:const_set, :HTTP, @magic_net_http)
end