Module: Seahorse::Client::NetHttp::Patches Private

Defined in:
lib/seahorse/client/net_http/patches.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Defined Under Namespace

Modules: Ruby_1_9_3, Ruby_2

Class Method Summary collapse

Class Method Details

.apply!Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


10
11
12
13
14
15
16
17
18
19
# File 'lib/seahorse/client/net_http/patches.rb', line 10

def self.apply!
  if RUBY_VERSION >= '2.0'
    Net::HTTP.send(:include, Ruby_2)
    Net::HTTP::IDEMPOTENT_METHODS_.clear
  elsif RUBY_VERSION >= '1.9.3'
    Net::HTTP.send(:include, Ruby_1_9_3)
  end
  Net::HTTP.send(:alias_method, :old_transport_request, :transport_request)
  Net::HTTP.send(:alias_method, :transport_request, :new_transport_request)
end