Skip to content

Instantly share code, notes, and snippets.

@BrayanZ
Last active December 17, 2015 01:39
Show Gist options
  • Save BrayanZ/5530449 to your computer and use it in GitHub Desktop.
Save BrayanZ/5530449 to your computer and use it in GitHub Desktop.
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