Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/remit/common.rb
Overview
Hack on Hash to make it s rocket
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.from_url_params(url_params) ⇒ Object
141 142 143 144 145 146 147 148 149 150 |
# File 'lib/remit/common.rb', line 141 def self.from_url_params(url_params) result = {} url_params.split('&').each do |element| element = element.split('=') # BJM - need to unescape the values in the param string #result[element[0]] = element[1] result[element[0]] = CGI.unescape(element[1]) end result end |
Instance Method Details
#to_url_params ⇒ Object
133 134 135 136 137 138 139 |
# File 'lib/remit/common.rb', line 133 def to_url_params elements = [] keys.size.times do |i| elements << "#{(keys[i])}=#{Remit::SignedQuery.escape_value(values[i])}" end elements.join('&') end |