End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Set#each
each(&block)
lib/set.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/set.rb, line 509
def each(&block)
block or return enum_for(__method__) { size }
@hash.each_key(&block)
self
end
Calls the given block once for each element in the set, passing the element as parameter. Returns an enumerator if no block is given.