def parse(url)
      if url[0] == '#'
        # url only updates fragment
        self.fragment = url[1..-1]
        update!
      else
        host = location.host
        protocol = location.protocol

        if url !~ /[:]\/\//
          # Add the host for local urls
          url = protocol + "//#{host}" + url
        else
          # Make sure its on the same protocol and host, otherwise its external.
          if url !~ /#{protocol}\/\/#{host}/
            # Different host, don't process
            return false
          end
        end

        matcher         = url.match(/^(#{protocol[0..-2]})[:]\/\/([^\/]+)(.*)$/)
        self.scheme     = matcher[1]
        self.host, port = matcher[2].split(':')

        self.port = (port || 80).to_i

        path           = matcher[3]
        path, fragment = path.split('#', 2)
        path, query    = path.split('?', 2)

        self.path     = path
        self.fragment = fragment
        self.query    = query

        result = assign_query_hash_to_params
      end

      # Wait until things are rendered before we scroll
      Volt::Timers.next_tick do
        scroll
      end

      result
    end
def parse(url)
      if url[0] == '#'
        # url only updates fragment
        self.fragment = url[1..-1]
        update!
      else
        host = location.host
        protocol = location.protocol

        if url !~ /[:]\/\//
          # Add the host for local urls
          url = protocol + "//#{host}" + url
        else
          # Make sure its on the same protocol and host, otherwise its external.
          if url !~ /#{protocol}\/\/#{host}/
            # Different host, don't process
            return false
          end
        end

        matcher         = url.match(/^(#{protocol[0..-2]})[:]\/\/([^\/]+)(.*)$/)
        self.scheme     = matcher[1]
        self.host, port = matcher[2].split(':')

        self.port = (port || 80).to_i

        path           = matcher[3]
        path, fragment = path.split('#', 2)
        path, query    = path.split('?', 2)

        self.path     = path
        self.fragment = fragment
        self.query    = query

        result = assign_query_hash_to_params
      end

      # Wait until things are rendered before we scroll
      Volt::Timers.next_tick do
        scroll
      end

      result
    end
Parse takes in a url and extracts each sections.
 It also assigns and changes to the params.