Created
July 18, 2011 18:59
-
-
Save ernie/1090334 to your computer and use it in GitHub Desktop.
Pure-ruby any (quick hack to test something)
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
module Enumerable | |
def any?(&block) | |
self.each do |v| | |
return true if yield(v) | |
end | |
false | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment