Class: RequestTagger::HttpMagic
- Inherits:
-
Object
- Object
- RequestTagger::HttpMagic
- Defined in:
- lib/request_tagger/http_magic.rb
Instance Method Summary collapse
-
#initialize ⇒ HttpMagic
constructor
A new instance of HttpMagic.
- #restore ⇒ Object
- #wrap ⇒ Object
Constructor Details
#initialize ⇒ HttpMagic
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
#restore ⇒ Object
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 |
#wrap ⇒ Object
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 |