Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/payture/hash.rb
Instance Method Summary collapse
Instance Method Details
#downcase_key ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/payture/hash.rb', line 4 def downcase_key keys.each do |k| v = self[k] v = v.is_a?(Hash) ? v.downcase_key : v store(k.downcase.to_sym, Array === (v = delete(k)) ? v.map(&:downcase_key) : v) end self end |
#url_encode ⇒ Object
13 14 15 |
# File 'lib/payture/hash.rb', line 13 def url_encode URI.encode(self.map{|k,v| "#{k}=#{v}"}.join(";")) end |