Sha256: 549dd8badea7fc155fbc745e2c3dba0c9c0b7111dd29930910870d17f30f72c4
Contents?: true
Size: 606 Bytes
Versions: 15
Compression:
Stored size: 606 Bytes
Contents
# # helpers.rb # Crowdskout # # Copyright (c) 2016 Kyle Schutt. All rights reserved. module Crowdskout module Util class Helpers class << self # Build the HTTP query from the given parameters # @param [Hash] params # @return [String] query string def http_build_query(params) params.collect{ |k,v| "#{k.to_s}=#{encode(v.to_s)}" }.reverse.join('&') end # Escape special characters # @param [String] str def encode(str) CGI.escape(str).gsub('.', '%2E').gsub('-', '%2D') end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems