End of Life Ruby 3.0 has reached end of life and gets no more fixes. 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.0.5/lib/set.rb, line 204
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.