The UriFormatter handles URIs from user-input and escaping.

uf = Gem::UriFormatter.new 'example.com'

p uf.normalize #=> 'http://example.com'
Attributes

uri

Read

The URI to be formatted.

Class Methods

Creates a new URI formatter for uri.

Instance Methods

Escapes the uri for use as a CGI parameter

Normalize the URI by adding “http://” if it is missing.

Unescapes the uri which came from a CGI parameter