DEV Community

Discussion on: Ruby 2.5 - Tap and Yield Self

Collapse
 
jesus_castello profile image
Jesus Castello • Edited

I love yield_self & tap, thanks for the article!

Btw you can get a similar effect pre-2.5 with to_enum(:tap).

That converts tap into an Enumerator object, which allows you to chain it with other methods without having to pass a block to tap.

Collapse
 
rpalo profile image
Ryan Palo

Neat! Thanks for the tip!