mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-28 04:23:59 +03:00
23 lines
560 B
Python
23 lines
560 B
Python
|
"""Example use cases package."""
|
||
|
|
||
|
|
||
|
class UseCase(object):
|
||
|
"""Abstract use case."""
|
||
|
|
||
|
def execute(self):
|
||
|
"""Execute use case handling."""
|
||
|
raise NotImplementedError()
|
||
|
|
||
|
|
||
|
class SignupUseCase(object):
|
||
|
"""Sign up use cases registers users."""
|
||
|
|
||
|
def __init__(self, email_sender):
|
||
|
"""Initializer."""
|
||
|
self.email_sender = email_sender
|
||
|
|
||
|
def execute(self, email):
|
||
|
"""Execute use case handling."""
|
||
|
print('Sign up user {0}'.format(email))
|
||
|
self.email_sender.send(email, 'Welcome, "{}"'.format(email))
|