Class: Addressable::URI

Inherits:
Object
  • Object
show all
Defined in:
lib/addressable-prettify.rb

Instance Method Summary collapse

Instance Method Details

#prettifyObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/addressable-prettify.rb', line 7

def prettify
  case scheme
  when 'http', 'https'
    host.sub(/^www\./, '') + path.sub(%r{(\.html?|/)$}, '')
  when 'mailto'
    path.to_s
  else
    to_s
  end
end