2 ms·
If you want, you can write Ruby Enumerators (not Enumerables) as well, which work like the Python example. A fairly concise example: https://garycordero1690.me
by burlesona 5y ago
If you want, you can write Ruby Enumerators (not Enumerables) as well, which work like the Python example.
A fairly concise example: https://garycordero1690.medium.com/ruby-enumerator-74b84615f4e8 https://garycordero1690.medium.com/ruby-enumerator-74b84615f...
- vidarh 5y agoOf course writing an Enumerator is writing the equivalent to an "each" method, hence why you can also trivially turn any object that implements each into an Enumerator.