Created
August 15, 2018 11:53
-
-
Save rachidcalazans/548ed4d504d8c8be39a3706e17930186 to your computer and use it in GitHub Desktop.
Example I for the Post - Design Patterns in Ruby - Strategy - Part I
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
receivers = [] | |
subject = 'Some subject' | |
content = 'Some content' | |
ios_app_token = 'Ja80-1jd81-AlI71' | |
ios_strategy = IosStrategy.new(ios_app_token) | |
ios_notification = Notification.new(ios_strategy, receivers, subject, content) | |
email_from = '[email protected]' | |
email_strategy = EmailStrategy.new(email_from) | |
email_notification = Notification.new(email_strategy, receivers, subject, content) | |
ios_notification.notify #=> 'Notifying through iOS Strategy. App token: Ja80-1jd81-AlI71' | |
email_notification.notify #=> 'Notifying through email Strategy. From: [email protected]' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment