Class: Bypass::URI

Inherits:
Addressable::URI
  • Object
show all
Defined in:
lib/bypass/uri.rb

Instance Method Summary collapse

Instance Method Details

#append_to_query_values(params = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/bypass/uri.rb', line 6

def append_to_query_values(params = {})
  pairs = params.keys.map do |raw_key|
    key = CGI.escape(raw_key.to_s)
    val = CGI.escape(params[raw_key])
    [key, val].join("=")
  end

  pairs.unshift(query) if query
  self.query = pairs.join("&")
end