Ruby version of list intersection.