daily pastebin goal
59%
SHARE
TWEET

Untitled

a guest Feb 17th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #== abstract Ride Factory
  2. class RideFactoryInterface:
  3.     def getRide(category):pass
  4.  
  5. #== concrete Ride Factory
  6. class Car(RideFactoryInterface):
  7.     @staticmethod
  8.     def getRide(category):
  9.         if category == "premium":
  10.             return CarPremiumRide()
  11.         if category == "delux":
  12.             return CarDeluxRide()
  13.         assert 0, "Couldn't find car " +category
  14.  
  15. class Bike(RideFactoryInterface):
  16.     @staticmethod
  17.     def getRide(category):
  18.         if category == "premium":
  19.             return BikePremiumRide()
  20.         if category == "delux":
  21.             return BikeDeluxRide()
  22.         assert 0, "Couldn't find Bike " +category
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top