This module is automatically included in subclasses of Set, to make them backwards compatible with the pure-Ruby set implementation used before Ruby 4. Users who want to use Set subclasses without this compatibility layer should subclass from Set::CoreSet.

Note that Set subclasses that access @hash are not compatible even with this support. Such subclasses must be updated to support Ruby 4.

Constants
No documentation available
Class Methods

Creates a new set containing the elements of the given enumerable object.

If a block is given, the elements of enum are preprocessed by the given block.

Set.new([1, 2])                       #=> #<Set: {1, 2}>
Set.new([1, 2, 1])                    #=> #<Set: {1, 2}>
Set.new([1, 'c', :s])                 #=> #<Set: {1, "c", :s}>
Set.new(1..5)                         #=> #<Set: {1, 2, 3, 4, 5}>
Set.new([1, 2, 3]) { |x| x * x }      #=> #<Set: {1, 4, 9}>
Instance Methods
No documentation available
An alias for
No documentation available
An alias for
An alias for
No documentation available
No documentation available
An alias for
An alias for
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available

Returns a string containing a human-readable representation of the set (“#<Set: {element1, element2, …}>”).

No documentation available
No documentation available
No documentation available
An alias for
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
An alias for
No documentation available