-
the power of yield and super · May 28, 2006
The two keywords
yield
andsuper
allow you to pass control back and forth between parent and child methods, to weave power between a more general method (in the parent class) and a more specific method (in the child class) with ease and logic. Usingyield
andsuper
effectively can help you maintain the DRY (Don’t repeat yourself) principle, keeping your code easier to maintain.