# File lib/sinatra/url_for.rb, line 32 def api_url_for(url_fragment, mode=:path_only) matrix_params = '' if request.params['api'] matrix_params += ";provider=%s" % request.params['api']['provider'] if request.params['api']['provider'] matrix_params += ";driver=%s" % request.params['api']['driver'] if request.params['api']['driver'] end url_fragment = "/#{url_fragment}" unless url_fragment =~ /^\// # There is no need to prefix URI with '/' url_for "#{settings.root_url}#{matrix_params}#{url_fragment}", mode end