Pretty sure it works since your normal initialize
method creates a non-yielding new
method. Since your custom .new
method does yield, it first calls into the non-yielding variant, then goes into your #tap
code which is why both foo
and bar
is printed.