Enumerator.newでごにょごにょやる..? それかまさかの自作..? と悩んだ方へ
結論
counter = (0..).each counter.next # => 0 counter.next # => 1 counter.next # => 2
Enumerator.newでごにょごにょやる..? それかまさかの自作..? と悩んだ方へ
counter = (0..).each counter.next # => 0 counter.next # => 1 counter.next # => 2