Method: Weak::Set::WeakKeys#each
- Defined in:
- lib/weak/set/weak_keys.rb
#each {|element| ... } ⇒ self, Enumerator
Calls the given block once for each live element in self
, passing that
element as a parameter. Returns the weak set itself.
If no block is given, an Enumerator
is returned instead.
62 63 64 65 66 67 68 69 |
# File 'lib/weak/set/weak_keys.rb', line 62 def each return enum_for(__method__) { size } unless block_given? @map.values.each do |obj| yield(obj) unless DeletedEntry === obj end self end |