Knowing when methods are removed
Both method_added
and singleton_method_added
have equivalent methods to track when methods are removed using Module#remove_method
.
They're called - you guessed it - method_removed
and singleton_method_removed
respectively.
As always, the best way to learn is through exercises, so lets do a couple of those.
Great! Now for singleton_method_removed
.
As with method_added
and singleton_method_added
, method_removed
is defined in Module
and singleton_method_removed
in BasicObject
.