Aliasing a class method

Hi,

I’ve made some changes to net/http that allows me to bind to a local
IP address using TCPSocket. The changes are in a separate script that
i require after net/http. Problem is that several warnings of
redefined methods pop up during my tests. I’ve managed to remove most
using alias_method except for one class method

…ruby/1.8/net/http.rb - line 450: HTTP.new

I’ve tried the following with no luck. The warning is still there.

module Net
class HTTP < Protocol
class << HTTP
alias_method :_new, :new
end
end
end

Regards,

mksm

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs