Skip to content

Instantly share code, notes, and snippets.

@wuputah
Forked from AndyMoreland/gist:465852
Created July 6, 2010 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wuputah/465884 to your computer and use it in GitHub Desktop.
Save wuputah/465884 to your computer and use it in GitHub Desktop.
class Hash
def map_values(&block)
inject(Hash.new) do |hsh, (k, v)|
hsh[k] = yield(v)
hsh
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment