Sha256: bb5482c773d1d9a77c648ffabdeb0ea7694e282ab21cc79af37b83f4a3a825dc
Contents?: true
Size: 265 Bytes
Versions: 3
Compression:
Stored size: 265 Bytes
Contents
# coding: utf-8 class Hash def symbolize_keys self.each_with_object({}){|(k,v),memo| memo[k.to_s.to_sym]=v} end def deep_symbolize_keys self.each_with_object({}){|(k,v),memo| memo[k.to_s.to_sym]=(v.is_a?(Hash) ? v.deep_symbolize_keys : v)} end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
methan-0.1.3 | lib/methan/util.rb |
methan-0.1.2 | lib/methan/util.rb |
methan-0.1.1 | lib/methan/util.rb |