Sha256: 9032eb0841dc05f881376269474af29dc3e8251c80fb42fac60e50cbc2312d3e
Contents?: true
Size: 323 Bytes
Versions: 15
Compression:
Stored size: 323 Bytes
Contents
class Hash def symbolize_keys self.each_with_object({}) do |(k, v), h| h[k.to_s.to_sym] = (v.is_a?(Hash) ? v.symbolize_keys : v) if v.is_a?(Array) h[k.to_s.to_sym] = v.each_with_object([]) do |h2, a| a << (h2.is_a?(Hash) ? h2.symbolize_keys : h2) end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems