I want to use the expression:
!([1,2,3] & [43,5]).empty? => false !([1,2,3] & [3,5]).empty? => true
to check if two arrays contain at least one common value. And I wonder if there is a better way to do this? Maybe something like:
([1,2,3] & [3,5]).non_empty?
How to write a non_empty? method non_empty? ?
ruby refactoring
klew May 20 '10 at 15:18 2010-05-20 15:18
source share