Created
November 25, 2008 10:24
-
-
Save Narnach/28873 to your computer and use it in GitHub Desktop.
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
# Syntactic sugar for #include? which is used in a lot of container-type classes. | |
# 1.in? [1,2,3] #=> true | |
# 2.in? [4,5,6] #=> false | |
module Kernel | |
def in?(enum) | |
enum.include?(self) | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment