instance method
Enumerable#to_set
() -> ::Set[Elem]
[T] () { (Elem) -> T } -> ::Set[T]
to_set(*args, &block)
prelude.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/prelude.rb, line 34
def to_set(*args, &block)
klass = if args.empty?
Set
else
warn "passing arguments to Enumerable#to_set is deprecated", uplevel: 1
args.shift
end
klass.new(self, *args, &block)
end
Makes a set from the enumerable object with given arguments. Passing arguments to this method is deprecated.
Ruby version changes
-
4.0
-
Passing arguments to
Set#to_setandEnumerable#to_setis now deprecated. [Feature #21390]
-