Skip to content

Instantly share code, notes, and snippets.

@BrayanZ
Created May 7, 2013 05:51
Show Gist options
  • Save BrayanZ/5530514 to your computer and use it in GitHub Desktop.
Save BrayanZ/5530514 to your computer and use it in GitHub Desktop.
class SMSNotification < Notification
def send
# sends a sms notification
end
end
class EmailNotification < Notification
def send
# sends an email with the notification
end
end
class PushNotification < Notification
def send
# sends a push notification
end
end
class Notification
def send
#
end
def self.send_notifications notifications_to_send
notifications_to_send.each { |notification| notification.send }
end
# ...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment