Method: Aitch::Location#location

Defined in:
lib/aitch/location.rb

#locationObject



14
15
16
17
18
19
20
21
22
# File 'lib/aitch/location.rb', line 14

def location
  return current_url unless current_url.match?(MATCHER)

  uri = find_uri_with_host
  url = ["#{uri.scheme}://#{uri.hostname}"]
  url << ":#{uri.port}" unless [80, 443].include?(uri.port)
  url << current_url
  url.join
end