encode_to_url (OpenID::Server::CheckIDRequest)

    # File lib/openid/server.rb, line 758
          def encode_to_url(server_url)
            # Encode this request as a URL to GET.
            #
            # server_url:: The URL of the OpenID server to make this
            #              request of.
            if !@return_to
              raise NoReturnToError
            end

            # Imported from the alternate reality where these classes are
            # used in both the client and server code, so Requests are
            # Encodable too.  That's right, code imported from alternate
            # realities all for the love of you, id_res/user_setup_url.
            q = {'mode' => @mode,
                 'identity' => @identity,
                 'claimed_id' => @claimed_id,
                 'return_to' => @return_to}

            if @trust_root
              if @namespace == OPENID1_NS
                q['trust_root'] = @trust_root
              else
                q['realm'] = @trust_root
              end
            end

            if @assoc_handle
              q['assoc_handle'] = @assoc_handle
            end

            response = Message.new(@namespace)
            response.update_args(@namespace, q)
            return response.to_url(server_url)
          end