DEV Community

Discussion on: Explaining S.O.L.I.D principles with Ruby code examples

Collapse
 
thorstenhirsch profile image
Thorsten Hirsch

Your examples make it as clear as the blue sky. Deserves much more views!

There's just a little mistake in the Server's serve_coffee, it should say "Here is your coffee". It is correct in the comments of the test code, but it's wrong ("...cappuccino") in the method implementation.

Collapse
 
nkemjiks profile image
Mbonu Blessing

Thanks for noticing the errors and the kind words. That mean alot. But the mistake is from the method implementation. It should be coffee not cappuccino. The point is that as a child, you should have the same method as the parent and can serve something similar as the parent class method. Cappuccino is a variation of coffee. I wouldn't need to override the parent method if I wanted to do exactly the same thing