I\'d like to replace each value in a hash with value.some_method.
value
value.some_method
For example, for given a simple hash:
{\"a\" => \"b\",
This will do it:
my_hash.each_with_object({}) { |(key, value), hash| hash[key] = value.upcase }
As opposed to inject the advantage is that you are in no need to return the hash again inside the block.
inject