Created
June 28, 2016 13:15
-
-
Save bjfish/22ae516a69ce906fdcc6538f88bce6ef to your computer and use it in GitHub Desktop.
for Hash
This file contains 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 to_proc | |
Proc.new do |key=undefined| | |
raise ArgumentError, "wrong number of arguments (given 0, expected 1)" if undefined.equal?(key) | |
self[key] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment