method

size

Importance_1
Ruby latest stable (v2_5_5) - 0 notes - Class: Enumerator
size() public

Returns the size of the enumerator, or nil if it can’t be calculated lazily.

(1..100).to_a.permutation(4).size # => 94109400
loop.size # => Float::INFINITY
(1..100).drop_while.size # => nil
Show source
Register or log in to add new notes.