Skip to content

Instantly share code, notes, and snippets.

@pasberth
Created November 8, 2011 16:58
Show Gist options
  • Select an option

  • Save pasberth/1348365 to your computer and use it in GitHub Desktop.

Select an option

Save pasberth/1348365 to your computer and use it in GitHub Desktop.
if item.in enum then A else B end
class Object
def in enum
enum.include? self
end
end
if 'a'.in ['a', 'b', 'c']
puts 'hello'
end
# => hello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment