# File lib/map/params.rb, line 66 def bytesize(string) string.bytesize end
# File lib/map/params.rb, line 73 def escape(s) URI.encode_www_form_component(s) end
# File lib/map/params.rb, line 44 def param_for(value, prefix = nil) case value when Array value.map { |v| param_for(v, "#{ prefix }[]") }.join("&") when Hash value.map { |k, v| param_for(v, prefix ? "#{ prefix }[#{ escape(k) }]" : escape(k)) }.join("&") when String raise ArgumentError, "value must be a Hash" if prefix.nil? "#{ prefix }=#{ escape(value) }" else prefix end end
Generated with the Darkfish Rdoc Generator 2.