Last active
January 4, 2016 07:19
-
-
Save budu/8587861 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Hash.class_eval do | |
| def recursive_map_values(&block) | |
| reduce({}) do |m, (k, v)| | |
| m[k] = v.is_a?(Hash) ? v.recursive_map_values(&block) : block.call(self, k, v) | |
| m | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment