Guest User

Untitled

a guest
Jul 18th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. module Net #:nodoc:
  2. class HTTP < Protocol
  3. # ... snip ...
  4.  
  5. class << HTTP
  6. alias newobj new
  7. end
  8.  
  9. # Creates a new Net::HTTP object.
  10. # If +proxy_addr+ is given, creates an Net::HTTP object with proxy support.
  11. # This method does not open the TCP connection.
  12. def HTTP.new(address, port = nil, p_addr = nil, p_port = nil, p_user = nil, p_pass = nil)
  13. h = Proxy(p_addr, p_port, p_user, p_pass).newobj(address, port)
  14. h.instance_eval {
  15. @newimpl = ::Net::HTTP.version_1_2?
  16. }
  17. h
  18. end
  19.  
  20. # Creates a new Net::HTTP object for the specified +address+.
  21. # This method does not open the TCP connection.
  22. def initialize(address, port = nil)
  23. # ... snip ...
  24. end
  25.  
  26. # ... snip ...
  27. end
  28. end
Add Comment
Please, Sign In to add comment