Sha256: 5a61b432a8f67b2dfff1f086981d104d8b9a5fbdcc33b91230ea7df1b34fd6db
Contents?: true
Size: 258 Bytes
Versions: 15
Compression:
Stored size: 258 Bytes
Contents
class Hash def symbolize_keys inject({}) do |result, (key, value)| new_key = key.is_a?(String) ? key.to_sym : key new_value = value.is_a?(Hash) ? value.symbolize_keys : value result[new_key] = new_value result end end end
Version data entries
15 entries across 15 versions & 1 rubygems