Great article! I've used this several times when I forgot about yield_self. Thanks very much for providing some simple use cases.
I also wanted to point out a typo in the line: .yield_self(&:shout), it should not contain the :. It should look like this to work: .yield_self(&shout). It got me confused why it didn't work for a while :)
I'm a Sr. Software Engineer at Flashpoint. I specialize in Python and Go, building functional, practical, and maintainable web systems leveraging Kubernetes and the cloud. Blog opinions are my own.
Great article! I've used this several times when I forgot about
yield_self. Thanks very much for providing some simple use cases.I also wanted to point out a typo in the line:
.yield_self(&:shout), it should not contain the:. It should look like this to work:.yield_self(&shout). It got me confused why it didn't work for a while :)Thanks! I fixed it. I appreciate the heads up!