End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Set#disjoint?
disjoint?(set)
lib/set.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/set.rb, line 335
def disjoint?(set)
!intersect?(set)
end
Returns true if the set and the given set 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