to_set(klass = Set, *args, &block)
public
Returns self if no arguments are given. Otherwise, converts the set to
another with klass.new(self, *args,
&block).
In subclasses, returns klass.new(self,
*args, &block) unless overridden.
# File lib/set.rb, line 211
def to_set(klass = Set, *args, &block)
return self if instance_of?(Set) && klass == Set && block.nil? && args.empty?
klass.new(self, *args, &block)
end