My Goal with Understanding Metaprogramming in Ruby

June 26, 2019 |

Article on Medium

My Goal with Understanding Metaprogramming in Ruby - Felipe Bohórquez - Medium

First things first let's dissect and define what .tap is doing here: .tap instantiates a new object and immediately pass it to a block. You see it right after object instantiation. Return value is automatically the object you modified (tapped). So it gets a new object a block level variable and whatever you tapped is the return value.