Last active
November 15, 2019 19:38
-
-
Save Naomi-Dennis/5936da7c366bc85801931567a704a2a8 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
class EntertainmentDevice: | |
def _connectToDeviceViaHDMICord(self, device): None | |
def _connectToDeviceViaRCACord(self, device): None | |
def _connectToDeviceViaEthernetCord(self, device): None | |
def _connectDeviceToPowerOutlet(self, device): None | |
class Television(EntertainmentDevice): | |
def connectToDVD(self, dvdPlayer): | |
self._connectToDeviceViaRCACord(dvdPlayer) | |
def connectToGameConsole(self, gameConsole): | |
self._connectToDeviceViaHDMICord(gameConsole) | |
def plugInPower(self): | |
self._connectDeviceToPowerOutlet(self) | |
class DVDPlayer(EntertainmentDevice): | |
def connectToTV(self, television): | |
self._connectToDeviceViaHDMICord(television) | |
def plugInPower(self): | |
self._connectDeviceToPowerOutlet(self) | |
class DvdPlayer(EntertainmentDevice): | |
def connectToTV(self, tv): | |
self._connectToDeviceViaRCACord(tv) | |
def plugInPower(self): | |
self._connectDeviceToPowerOutlet(self) | |
class GameConsole(EntertainmentDevice): | |
def conenctToTV(self, television): | |
self._connectToDeviceViaHDMICord(television) | |
def plugInPower(self): | |
self._connectDeviceToPowerOutlet(self) | |
class Router(EntertainmentDevice): | |
def connectToTV(self, television): | |
self._connectToDeviceViaEthernetCord(television) | |
def connectToGameConsole(self, gameConsole): | |
self._connectToDeviceViaEthernetCord(gameConsole) | |
def plugInPower(self): | |
self._connectDeviceToPowerOutlet(self) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment