Created
December 4, 2020 18:36
-
-
Save matiasdim/bf2b5958884d9f49e8b5b5c5d4e3a1da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol ATM { | |
func depositMoney() | |
func withdrawMoney() | |
} | |
// Simple ATM Machine CANNOT deposit money | |
class simpleATM: ATM { | |
func depositMoney() { | |
// This method is not used for this class, since it does not have this capability | |
} | |
func withdrawMoney() { | |
// Logic to withdraw money | |
} | |
} | |
class greatATM: ATM { | |
func depositMoney() { | |
// Logic to deposit money | |
} | |
func withdrawMoney() { | |
// Logic to withdraw money | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment