Created
December 23, 2014 12:41
-
-
Save 5t111111/fd715cacfd492223ecab 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
| def iterate(h, depth: 0) | |
| h.each do |k,v| | |
| value = v || k | |
| puts "-" * depth + " " + k | |
| if value.is_a?(Hash) | |
| iterate(value, depth: depth + 1) | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment