Method: Immutable::SortedSet#difference

Defined in:
lib/immutable/sorted_set.rb

#difference(other) ⇒ SortedSet Also known as: subtract, -

Return a new SortedSet with all the items in other removed. other can be any Enumerable object.

Examples:

Immutable::SortedSet[1, 2] - Immutable::SortedSet[2, 3]
# => Immutable::SortedSet[1]

Parameters:

  • other (Enumerable)

    The collection to subtract from this set

Returns:



634
635
636
# File 'lib/immutable/sorted_set.rb', line 634

def difference(other)
  self.class.alloc(@node.bulk_delete(other))
end