You can try:
Example: if Cat and Dog exist in the array:
(['Cat','Dog','Bird'] & ['Cat','Dog'] ).size == 2 #or replace 2 with ['Cat','Dog].size
Instead of:
['Cat','Dog','Bird'].member?('Cat') and ['Cat','Dog','Bird'].include?('Dog')
Note: member?
and include?
are the same.
This can do the work in one line!