Skip to content

Instantly share code, notes, and snippets.

@Naomi-Dennis
Last active November 15, 2019 19:38
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