Skip to content

Instantly share code, notes, and snippets.

@guyjacks
Last active December 14, 2017 00:02
Show Gist options
  • Save guyjacks/217086dbe223b72a16ebbe96ac5d80d4 to your computer and use it in GitHub Desktop.
Save guyjacks/217086dbe223b72a16ebbe96ac5d80d4 to your computer and use it in GitHub Desktop.
class ActionType(object):
def __init__(self, handle, human, points, notification):
self.handle = handle
self.human = human
self.points = points
# expects a string template to be formatted
self.notification = notification
def is_influence(self):
return False
def notify(self):
raise NotImplementedError
class Fund(Action):
def __init__(self):
...
notification = 'You have earned {points} points for for giving ${amount} to {organization}.'
super(..., notification)
def notify(self, points, amount, organization):
return self.notification.format(points, amount, notification)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment