Implementing yield-or-enumerate semantics
Ruby’s core collection classes have a number of methods which return an Enumerator if they are called without a block. A while back I made a quick video showing how to replicate this behavior in your own methods. It’s now free to watch.
Post a comment