Aliasing a class method

R

Ricardo Amorim

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top