Sha256: a8ff03910d73e766b12000546fb8fa27e35f70ba1a1a9eef7068bda9bd4aafd8

Contents?: true

Size: 411 Bytes

Versions: 4

Compression:

Stored size: 411 Bytes

Contents

module DeviseTokenAuth::Url

  def self.generate(url, params = {})
    uri = URI(url)

    res = "#{uri.scheme}://#{uri.host}"
    res += ":#{uri.port}" if (uri.port and uri.port != 80 and uri.port != 443)
    res += "#{uri.path}" if uri.path    
    query = [uri.query, params.to_query].reject(&:blank?).join('&')
    res += "?#{query}"
    res += "##{uri.fragment}" if uri.fragment

    return res
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
devise_token_auth-0.1.39 lib/devise_token_auth/url.rb
devise_token_auth-0.1.38 lib/devise_token_auth/url.rb
devise_token_auth-0.1.37 lib/devise_token_auth/url.rb
devise_token_auth-0.1.37.beta4 lib/devise_token_auth/url.rb