Mailing the story:
The Power of 'yield' in Ruby
...and
super
. These two keywords 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. Using yield
and super
effectively can help you maintain the DRY (Don't repeat yourself) principle, keeping your code easier to maintain.