Sha256: 341237b7bee395d2b2b880fa051f1468854e409960e0e13f01c8532f4d6af1d7
Contents?: true
Size: 351 Bytes
Versions: 13
Compression:
Stored size: 351 Bytes
Contents
class Hash def symbolize_keys inject({}) do |options, (key, value)| options[(key.to_sym rescue key) || key] = value options end end def symbolize_keys! self.replace(symbolize_keys) end def symbolize_recursively! self.replace(symbolize_keys) self.each do |k, v| if v.kind_of?(Hash) v.symbolize_keys! end end end end
Version data entries
13 entries across 13 versions & 2 rubygems