instance method
Set#disjoint?
(::Set[A] | ::Enumerable[A]) -> bool
disjoint?(set) → true or false
set.c
View on GitHub ↗
static VALUE
set_i_disjoint(VALUE set, VALUE other)
{
return RBOOL(!RTEST(set_i_intersect(set, other)));
}
Returns true if the set and the given enumerable have no element in common. This method is the opposite of intersect?.
Example
Set[1, 2, 3].disjoint? Set[3, 4] #=> false Set[1, 2, 3].disjoint? Set[4, 5] #=> true Set[1, 2, 3].disjoint? [3, 4] #=> false Set[1, 2, 3].disjoint? 4..5 #=> true