Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Set#each
() { (A) -> void } -> self
() -> ::Enumerator[A, self]
each(&block)
lib/set.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/lib/set.rb, line 502
def each(&block)
block_given? 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.