Sha256: 1eefe4ef86084f772cddfc80184358b7992c7e33a9945d21c71f380e83a087a7
Contents?: true
Size: 421 Bytes
Versions: 17
Compression:
Stored size: 421 Bytes
Contents
# Collection of utility methods for the Hash object class HashUtil # Returns a hash with the keys converted to symbols def self.deep_symbolize_keys(hash) hash.keys.each do |key| value = hash[key] hash.delete(key) hash[key.to_sym] = value if hash[key.to_sym].instance_of? Hash hash[key.to_sym] = HashUtil.deep_symbolize_keys(hash[key.to_sym]) end end hash end end
Version data entries
17 entries across 17 versions & 1 rubygems