I would appreciate it if someone could help me understand the difference between using a Yielder in an Enumerator vs. just invoking yield in an Enumerator.
The “Well-grounded Rubyist” suggests that one doesn’t “yield from the block” but doesn’t explain precisely what’s going on.
Thanks
The
Enumerator::Yielder#yieldmethod and theEnumerator::Yielder::<<method are exactly the same. In fact, they are aliases.So, which one of those two you use, is 100% personal preference, just like
Enumerable#collectandEnumerable#maporEnumerable#injectandEnumerable#reduce.