class Hash

Public Instance Methods

hmap(&block) click to toggle source
# File lib/core_ext/hash.rb, line 4
def hmap(&block)
  reduce({}) { |hash, (k, v)| hash.merge(block.call(k, v)) }
end
hmap!(&block) click to toggle source
# File lib/core_ext/hash.rb, line 8
def hmap!(&block)
  replace hmap(&block)
end