Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self._description = "Dark Roast Coffee"
def cost(self):
return .99
class Espresso(Beverage):
def __init__(self):
self._description = "Espresso"
def cost(self):
return 1.99
class Decaf(Beverage):
def __init__(self):
self._description = "Decaf Coffee"
def cost(self):
return 1.05
###############################################################################
# Condiment decorators
###############################################################################
class CondimentDecorator(Beverage):
__metaclass__ = ABCMeta
@abstractmethod
class Beverage:
__metaclass__ = ABCMeta
def __init__(self):
self._description = "Unknown Beverage"
def get_description(self):
return self._description
@abstractmethod
def cost(self):
pass
class HouseBlend(Beverage):
def __init__(self):
self._description = "House Blend Coffee"
def cost(self):
return .89
class DarkRoast(Beverage):
def __init__(self):
self._description = "Dark Roast Coffee"
def cost(self):
return .99
@abstractmethod
def cost(self):
pass
class HouseBlend(Beverage):
def __init__(self):
self._description = "House Blend Coffee"
def cost(self):
return .89
class DarkRoast(Beverage):
def __init__(self):
self._description = "Dark Roast Coffee"
def cost(self):
return .99
class Espresso(Beverage):
def __init__(self):
self._description = "Espresso"
def cost(self):
return 1.99
self._description = "House Blend Coffee"
def cost(self):
return .89
class DarkRoast(Beverage):
def __init__(self):
self._description = "Dark Roast Coffee"
def cost(self):
return .99
class Espresso(Beverage):
def __init__(self):
self._description = "Espresso"
def cost(self):
return 1.99
class Decaf(Beverage):
def __init__(self):
self._description = "Decaf Coffee"
def cost(self):
return 1.05
class Decaf(Beverage):
def __init__(self):
self._description = "Decaf Coffee"
def cost(self):
return 1.05
###############################################################################
# Condiment decorators
###############################################################################
class CondimentDecorator(Beverage):
__metaclass__ = ABCMeta
@abstractmethod
def get_description(self):
pass
class Milk(CondimentDecorator):
def __init__(self, beverage):
self._beverage = beverage
def get_description(self):
return self._beverage.get_description() + ", Milk"
def cost(self):