Sha256: dca7d0a71a00d0647e72887412fdb0071d5a52ef6083fca3529c4605a1dac29c
Contents?: true
Size: 494 Bytes
Versions: 23
Compression:
Stored size: 494 Bytes
Contents
class Hash unless method_defined?(:to_query) def to_query elements = [] self.each do |key, value| elements << "#{CGI::escape(key.to_s)}=#{CGI::escape(value.to_s)}" end elements.join('&') end end unless method_defined?(:reverse_merge) def reverse_merge(other_hash) other_hash.merge(self) end end unless method_defined?(:reverse_merge!) def reverse_merge!(other_hash) replace(reverse_merge(other_hash)) end end end
Version data entries
23 entries across 23 versions & 1 rubygems