Class: Net::HTTP
- Inherits:
-
Object
- Object
- Net::HTTP
- Defined in:
- lib/http_configuration.rb
Defined Under Namespace
Classes: Configuration
Class Method Summary collapse
Class Method Details
.new_with_configuration(address, port = nil, p_addr = nil, p_port = nil, p_user = nil, p_pass = nil) ⇒ Object Also known as: new
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/http_configuration.rb', line 9 def new_with_configuration (address, port = nil, p_addr = nil, p_port = nil, p_user = nil, p_pass = nil) = Configuration.current if if Configuration.no_proxy?(address, ) p_addr = nil p_port = nil p_user = nil p_pass = nil elsif p_addr.nil? and [:proxy_host] p_addr = [:proxy_host] p_port = [:proxy_port].to_i p_user = [:proxy_user] p_pass = [:proxy_password] end end http = HTTP.new_without_configuration(address, port, p_addr, p_port, p_user, p_pass) if http.open_timeout = [:open_timeout] if [:open_timeout] http.read_timeout = [:read_timeout] if [:read_timeout] end return http end |