class Crowdskout::Util::Helpers
Public Class Methods
encode(str)
click to toggle source
Escape special characters @param [String] str
# File lib/crowdskout/util/helpers.rb, line 21 def encode(str) CGI.escape(str).gsub('.', '%2E').gsub('-', '%2D') end
http_build_query(params)
click to toggle source
Build the HTTP query from the given parameters @param [Hash] params @return [String] query string
# File lib/crowdskout/util/helpers.rb, line 15 def http_build_query(params) params.collect{ |k,v| "#{k.to_s}=#{encode(v.to_s)}" }.reverse.join('&') end