Module: Doorkeeper::OAuth::Authorization::URIBuilder

Extended by:
URIBuilder
Includes:
Rack::Utils
Included in:
URIBuilder, CodeResponse, ErrorResponse
Defined in:
lib/doorkeeper/oauth/authorization/uri_builder.rb

Instance Method Summary collapse

Instance Method Details

#build_query(parameters = {}) ⇒ Object



22
23
24
25
# File 'lib/doorkeeper/oauth/authorization/uri_builder.rb', line 22

def build_query(parameters = {})
  parameters = parameters.reject { |k, v| v.blank? }
  super parameters
end

#uri_with_fragment(url, parameters = {}) ⇒ Object



16
17
18
19
20
# File 'lib/doorkeeper/oauth/authorization/uri_builder.rb', line 16

def uri_with_fragment(url, parameters = {})
  uri = URI.parse(url)
  uri.fragment = build_query(parameters)
  uri.to_s
end

#uri_with_query(url, parameters = {}) ⇒ Object



9
10
11
12
13
14
# File 'lib/doorkeeper/oauth/authorization/uri_builder.rb', line 9

def uri_with_query(url, parameters = {})
  uri            = URI.parse(url)
  original_query = parse_query(uri.query)
  uri.query      = build_query(original_query.merge(parameters))
  uri.to_s
end