Sha256: 049dad5c2c6b533bc4b1989a6d6090285a7b01669b86ef9782f0513bdd87da64
Contents?: true
Size: 516 Bytes
Versions: 16
Compression:
Stored size: 516 Bytes
Contents
class ::Hash # via https://stackoverflow.com/a/25835016/2257038 def stringify_keys h = self.map do |k, v| v_str = if v.instance_of? Hash v.stringify_keys else v end [k.to_s, v_str] end Hash[h] end # via https://stackoverflow.com/a/25835016/2257038 def symbol_keys h = self.map do |k, v| v_sym = if v.instance_of? Hash v.symbol_keys else v end [k.to_sym, v_sym] end Hash[h] end end
Version data entries
16 entries across 16 versions & 1 rubygems