Flowdock
method

new2

Importance_0
Ruby latest stable (v1_9_3_392) - 0 notes - Class: Client
new2(uri, proxy=nil, timeout=nil) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/xmlrpc/client.rb, line 340
    def new2(uri, proxy=nil, timeout=nil)
      if match = /^([^:]+):\/\/(([^@]+)@)?([^\/]+)(\/.*)?$/.match(uri)
        proto = match[1]
        user, passwd = (match[3] || "").split(":")
        host, port = match[4].split(":")
        path = match[5]

        if proto != "http" and proto != "https"
          raise "Wrong protocol specified. Only http or https allowed!"
        end

      else
        raise "Wrong URI as parameter!"
      end

      proxy_host, proxy_port = (proxy || "").split(":")

      self.new(host, path, port, proxy_host, proxy_port, user, passwd, (proto == "https"), timeout)
    end
Register or log in to add new notes.