Method: Cantor::AbsoluteSet#difference

Defined in:
lib/cantor/absolute_set.rb

#difference(other) ⇒ Object



171
172
173
174
175
176
177
178
179
# File 'lib/cantor/absolute_set.rb', line 171

def difference(other)
  if other.is_a?(AbsoluteSet) and other.universe.eql?(@universe)
    copy(:mask => @mask & ~other.mask)
  elsif other.is_a?(AbstractSet) and other.infinite?
    intersection(other.complement)
  else
    copy(:mask => @mask & ~as_mask(other, false))
  end
end