Skip to content

Instantly share code, notes, and snippets.

@matiasdim
Created December 4, 2020 18:36
Show Gist options
  • Save matiasdim/bf2b5958884d9f49e8b5b5c5d4e3a1da to your computer and use it in GitHub Desktop.
Save matiasdim/bf2b5958884d9f49e8b5b5c5d4e3a1da to your computer and use it in GitHub Desktop.
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