2008/8/20 Brian Ross <p.brian.ross / gmail.com>:
> How can I iterate through a hash so that each key is modified and saved into
> a new hash?
>
> # Beginning of code
>
> hash = {"name"=>"greg", "job"=>"boring", "hair"=>"plenty"}
> p hash
>
> map = hash.each_key do |key|
>  key.upcase
> end
>
> p map
>
> # End of code

Hash[*hash.map{|key,value| [key.upcase, value]}.flatten]

Farrel
-- 
Aimred - Ruby Development and Consulting
http://www.aimred.com