Created
July 28, 2010 17:55
-
-
Save reinh/495546 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 short_circuit_fetch(*keys) | |
| result = self | |
| keys.each do |key| | |
| result = result[key] | |
| break unless result | |
| end | |
| result | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment