Skip to content

Instantly share code, notes, and snippets.

@quirkey
Created September 17, 2009 17:54
Show Gist options
  • Save quirkey/188618 to your computer and use it in GitHub Desktop.
Save quirkey/188618 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