Реклама

Ruby – Redefinition of methods

In a subclass, we can change the behavior of the instances by redefining superclass methods. Suppose we would rather enhance the superclass’s identifity method than entirely replace it. For this we can use super. super lets us pass arguments to the original method. It is sometimes said that there are two kinds of people…