Module: VaultedBilling::CoreExt::Hash::ClassMethods

Defined in:
lib/vaulted_billing/core_ext/hash.rb

Instance Method Summary collapse

Instance Method Details

#from_querystring(string) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/vaulted_billing/core_ext/hash.rb', line 13

def from_querystring(string)
  return {} if string.nil?
  ::Hash[*(string.split(/&/).
    collect { |i| i.split(/=/) }.
    collect { |e| e.size == 1 ? (e << '') : e }.flatten.
    collect { |e| CGI.unescape(e) })]
end