Skip to content

Instantly share code, notes, and snippets.

Created November 23, 2016 09:05
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 anonymous/9807f20ec40dee0325ecae281cb0faa8 to your computer and use it in GitHub Desktop.
Save anonymous/9807f20ec40dee0325ecae281cb0faa8 to your computer and use it in GitHub Desktop.
class Hash
def map_pairs
self.replace(
self.map{ |k, v|
yield(k,v)
}.to_h
)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment