Parent

Methods

HttpOptions

Attributes

uri[R]
method[R]
host[R]
port[R]
options[R]

Public Class Methods

new(method, uri, options) click to toggle source
    # File lib/em-http/http_options.rb, line 4
 4:   def initialize(method, uri, options)
 5:     raise ArgumentError, "invalid request path" unless /^\// === uri.path
 6: 
 7:     @options = options
 8:     @method = method.to_s.upcase
 9:     @uri = uri
10: 
11:     if proxy = options[:proxy]
12:       @host = proxy[:host]
13:       @port = proxy[:port]
14:     else
15:       @host = uri.host
16:       @port = uri.port
17:     end
18: 
19:     @options[:timeout]    ||= 10  # default connect & inactivity timeouts
20:     @options[:redirects]  ||= 0   # default number of redirects to follow
21: 
22:     # Make sure the ports are set as Addressable::URI doesn't
23:     # set the port if it isn't there
24:     if uri.scheme == "https"
25:       @uri.port ||= 443
26:       @port     ||= 443
27:     else
28:       @uri.port ||= 80
29:       @port     ||= 80
30:     end
31:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.