Files

Patron::Util

Public Instance Methods

build_query_pairs_from_hash(hash, escape_values=false) click to toggle source
    # File lib/patron/util.rb, line 32
32:     def build_query_pairs_from_hash(hash, escape_values=false)
33:       pairs = []
34:       recursive = Proc.new do |h, prefix|
35:         h.each_pair do |k,v|
36:           key = prefix == '' ? k : "#{prefix}[#{k}]"
37:           v = CGI::escape(v.to_s) if escape_values
38:           v.is_a?(Hash) ? recursive.call(v, key) : pairs << "#{key}=#{v}"
39:         end
40:       end
41:       recursive.call(hash, '')
42:       pairs
43:     end
build_query_string_from_hash(hash, escape_values=false) click to toggle source
    # File lib/patron/util.rb, line 45
45:     def build_query_string_from_hash(hash, escape_values=false)
46:       build_query_pairs_from_hash(hash, escape_values).join('&')
47:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.