Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/ecpay_invoice/core_ext/hash.rb

Instance Method Summary collapse

Instance Method Details

#stringify_keysObject



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/ecpay_invoice/core_ext/hash.rb', line 2

def stringify_keys
  result = self.class.new
  orig_key_len = keys.length()
  each_key do |key|
    result[key.to_s] = self[key]
  end
  unless result.keys.length() == orig_key_len
      raise "Duplicate key name during convertion, there might be symbol & string key with the same name."
  end
  return result
end