Class: Hash

Inherits:
Object show all
Defined in:
lib/modalsupport/hash.rb

Instance Method Summary collapse

Instance Method Details

#map_hash(&b) ⇒ Object



5
6
7
8
9
# File 'lib/modalsupport/hash.rb', line 5

def map_hash(&b)
  res = {}
  each {|k,v| res[k] = b.arity == 1 ? yield(v) : yield(k, v) }
  res
end