Skip to content

Instantly share code, notes, and snippets.

@alexslade
Created March 26, 2014 21:26
Show Gist options
  • Save alexslade/9793958 to your computer and use it in GitHub Desktop.
Save alexslade/9793958 to your computer and use it in GitHub Desktop.
class Postman
include Interactor
def perform(context)
if member.push_token_registered?
send_via_push
else
send_via_sms
end
end
private
def send_via_push
CreatePushMessageLog.perform(context)
CreatePushMessageSummary.perform(context)
EnqueuePushMessageDelivery.perform(context)
end
def send_via_sms
CreateSmsMessageLog.perform(context)
CreateSmsMessageSummary.perform(context)
EnqueueSmsMessageDelivery.perform(context)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment