Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Set#to_set
to_set(klass = Set, *args, &block)
lib/set.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/set.rb, line 351
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
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.