to_s()
public
Constructs <a href="/ruby/String">String</a> from URI
Show source
def to_s
str = ''
if @scheme
str << @scheme
str << ':'
end
if @opaque
str << @opaque
else
if @registry
str << @registry
else
if @host
str << '//'
end
if self.userinfo
str << self.userinfo
str << '@'
end
if @host
str << @host
end
if @port && @port != self.default_port
str << ':'
str << @port.to_s
end
end
str << path_query
end
if @fragment
str << '#'
str << @fragment
end
str
end