Ruby non_empty? method

refactoring, ruby

Solution

([1,2,3] & [3,5]).any?

Problem

I want to use expression: ``` !([1,2,3] & [43,5]).empty? => false !([1,2,3] & [3,5]).empty? => true ``` to check if two arrays contains at least one common value. And I wonder if there is a better way of doing it? Maybe something like: ``` ([1,2,3] & [3,5]).non_empty? ``` How to write `non_empty?` method?

Original source