Skip to content

Instantly share code, notes, and snippets.

@Narnach
Created November 25, 2008 10:24
Show Gist options
  • Save Narnach/28873 to your computer and use it in GitHub Desktop.
Save Narnach/28873 to your computer and use it in GitHub Desktop.
# 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