Sha256: 4403f125ca4a10dde2177a3b7c4974e011e95f67bf8010c133708a01eb67a7e7
Contents?: true
Size: 355 Bytes
Versions: 17
Compression:
Stored size: 355 Bytes
Contents
class Symbolizer def self.recursive_symbolize(hash) {}.tap do |h| hash.each { |key, value| h[key.to_sym] = self.map_value(value) } end end private def self.map_value(thing) case thing when Hash self.recursive_symbolize(thing) when Array thing.map { |v| map_value(v) } else thing end end end
Version data entries
17 entries across 17 versions & 1 rubygems