# File rice/url.rb, line 131 def to_s str = "#{@scheme}://" if !@username.nil? && @scheme != 'http' str << CGI::escape(@username) str << ":#{@password}" if @password str << '@' end str << @host str << ":#{@port}" if @port str << @path if @args.length > 0 argList = [] @args.each { | key, value | argList << "#{CGI::escape(key)}=#{CGI::escape(value)}" } str << '?' str << argList.join('&') end return str end