Sha256: 3bb7b1568601fdd0439e731799b08b7ce677769ed5fe97961f51f92434dbb66d
Contents?: true
Size: 264 Bytes
Versions: 1
Compression:
Stored size: 264 Bytes
Contents
class Hash def symbolize_keys inject(Hash.new) 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
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
recognizer-0.1.6 | lib/recognizer/patches/hash.rb |