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 :)
Ryan is an engineer in the Sacramento Area with a focus in Python, Ruby, and Rust. Bash/Python Exercism mentor. Coding, physics, calculus, music, woodworking. Looking for work!
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!