Sha256: c813619cd7a60cb77a889c8f5418e5df57f59338e00684c8e4f1a13bb0821f92
Contents?: true
Size: 420 Bytes
Versions: 11
Compression:
Stored size: 420 Bytes
Contents
class Hash def symbolize_keys each_with_object({}) do |(key, value), options| options[(begin key.to_sym rescue key end) || key] = value end end def symbolize_keys! replace(symbolize_keys) end def symbolize_recursively! replace(symbolize_keys) each do |_k, v| v.symbolize_keys! if v.is_a?(Hash) end end end
Version data entries
11 entries across 11 versions & 1 rubygems