Sha256: 6bc74587aed227b463ebb8b7c1b4e783382d317bb53a519f4d3dec1e88285d90
Contents?: true
Size: 420 Bytes
Versions: 34
Compression:
Stored size: 420 Bytes
Contents
class Hash # :nodoc: # Thanks merb! def symbolize_keys! each do |k,v| sym = k.respond_to?(:to_sym) ? k.to_sym : k self[sym] = Hash === v ? v.symbolize_keys! : v delete(k) unless k == sym end self end def rename(candidates) candidates.each do |old_key, new_key| self[new_key] = self.delete(old_key) if self.has_key?(old_key) end return self end end
Version data entries
34 entries across 34 versions & 2 rubygems