Why override on OneClass.new as following code not cause infinite loop?

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.