Sha256: caa79e24e295b6e695862ed9d21c4c560b835634e25505cc390e03d0990bd9ef
Contents?: true
Size: 394 Bytes
Versions: 10
Compression:
Stored size: 394 Bytes
Contents
class Hash def self.recursive new do |hash, key| hash[key] = recursive end end def symbolize_keys reduce({}) do |memo, (key, value)| memo.merge! key.to_sym => value end end def sort_with_keys sort.to_h.tap do |hash| hash.each_pair do |key, value| hash.merge! key => value.sort_with_keys if value.is_a?(Hash) end end end end
Version data entries
10 entries across 10 versions & 1 rubygems