Assume that we already had the code:
1 2 3 4 5 6 7 8 9 10 11 |
|
This principle applies only to inheritance. In order to comply with the Liskov Substitution Principle, Subtypes must be substitutable for their base types.
Well, so they must have the same interface. Since ruby does not have abstract methods, we can do it like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
So far so good, That’s it!!! See ya!!! :)