replace(enum)
public
Replaces the contents of the set with the contents of the given enumerable
object and returns self.
set = Set[1, 'c', :s]
set.replace([1, 2])
set
Show source
def replace(enum)
if enum.instance_of?(self.class)
@hash.replace(enum.instance_variable_get(:@hash))
self
else
do_with_enum(enum)
clear
merge(enum)
end
end