Last active
December 14, 2017 00:02
-
-
Save guyjacks/217086dbe223b72a16ebbe96ac5d80d4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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