Skip to content

Instantly share code, notes, and snippets.

@chef
Forked from quirkey/file.rb
Created September 17, 2009 19:20
Show Gist options
  • Save chef/188665 to your computer and use it in GitHub Desktop.
Save chef/188665 to your computer and use it in GitHub Desktop.
class Array
def includes?(other_array)
(self & other_array) == other_array
end
end
[1,2,3].includes?([2,3]) #=> true
[1,2,3].includes?([3,4]) #=> false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment