Skip to content

Instantly share code, notes, and snippets.

@rbxbx
Created January 12, 2011 21:10
Show Gist options
  • Select an option

  • Save rbxbx/776884 to your computer and use it in GitHub Desktop.

Select an option

Save rbxbx/776884 to your computer and use it in GitHub Desktop.
Hash#map_keys
class Hash
def map_keys(&blk)
Hash[keys.map(&blk).zip(values)]
end
end
@sandro
Copy link

sandro commented Jan 12, 2011

hot

@rbxbx
Copy link
Author

rbxbx commented Jan 12, 2011

:D

Unfortunately, ended up not needing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment