Skip to content
instance method

Set#to_set

() -> ::Set[A]
[T] () { (A) -> T } -> ::Set[T]
to_set(klass = Set, *args, &block) → self or new_set

Without arguments, returns self (for duck-typing in methods that accept “set, or set-convertible” arguments).

A form with arguments is deprecated. It converts the set to another with klass.new(self, *args, &block).

Ruby version changes

  1. 4.0
See also #to_s #union #to_json also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0