Class: Addressable::URI

Inherits:
Object
  • Object
show all
Defined in:
lib/monkey_patches/addressable/uri.rb

Overview

Patch for Addressable’s URI class

Class Method Summary collapse

Class Method Details

.canonicalize(uri) ⇒ Object



5
6
7
8
9
# File 'lib/monkey_patches/addressable/uri.rb', line 5

def self.canonicalize(uri)
  url = parse(uri).to_s # uri can be anything Addressable::URI can handle
  canonical_url = URLCanonicalize.canonicalize(url)
  parse(canonical_url)
end