Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

Enumerator::Chain#size

() -> (::Integer | ::Float)?
obj.size → int, Float::INFINITY or nil

Returns the total size of the enumerator chain calculated by summing up the size of each enumerable in the chain. If any of the enumerables reports its size as nil or Float::INFINITY, that value is returned as the total size.

See also #rewind #inspect also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0