Created
June 9, 2015 14:13
-
-
Save patrykkalinowski/c7bc2a9a25c38779307e to your computer and use it in GitHub Desktop.
dependency injection
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
class Trial | |
def check_activity | |
if activity > 100 | |
send_mail(Mailer) | |
end | |
end | |
def send_mail(mail) | |
mail.new(id, name, date, total_activity) | |
end | |
end | |
class Mailer | |
def initialize(id, name, date, total_activity) | |
# blabla | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment