Last active
December 17, 2015 01:39
-
-
Save BrayanZ/5530449 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 Notification | |
def initialze(kind, body) | |
@kind, @body = kind, body | |
end | |
def send_sms_notification | |
# sends a sms notification | |
end | |
def send_email_notification | |
# sends a email with the notification | |
end | |
def send_push_notification | |
# sends a push notification | |
end | |
def self.send_notification notifications_to_send | |
notifications_to_send.each do |notification| | |
case notification.kind | |
when :sms | |
notification.send_sms_notification | |
when :email | |
notification.send_email_notification | |
when :push | |
notification.send_push_notification | |
end | |
end | |
end | |
# ... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment