Skip to content

Instantly share code, notes, and snippets.

@Naomi-Dennis
Last active November 15, 2019 19:38
Show Gist options
  • Save Naomi-Dennis/5936da7c366bc85801931567a704a2a8 to your computer and use it in GitHub Desktop.
Save Naomi-Dennis/5936da7c366bc85801931567a704a2a8 to your computer and use it in GitHub Desktop.
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