Created
December 28, 2020 21:52
-
-
Save jangia/767f1cb5cbe94e666ce2f6d02cfc171c to your computer and use it in GitHub Desktop.
SRP violated
This file contains 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
import datetime | |
class User: | |
def __init__(self, username, banned_until): | |
self.username = username | |
self.banned_until = banned_until | |
def save(self): | |
print('I am saving to PostgreSQL') | |
def ban(self): | |
self.banned_until = datetime.datetime.today() + datetime.timedelta(days=7) | |
def charge(self): | |
print('Charge credit card of user using Stripe') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment