Created
July 9, 2016 14:43
-
-
Save evanjmg/59308df8671d0785c69fc7f8c1fc8583 to your computer and use it in GitHub Desktop.
This file contains 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 UberService | |
def run | |
#... all the other stuff we did before | |
send_pusher(data, build_pusher_notification(data)) | |
end | |
def send_pusher(response, text) | |
channel = 'private-' + @current_identity.user.id.to_s | |
Pusher.trigger(channel, 'notification', { | |
data: { | |
places: response[:places].map { |i| i['id'] }, | |
start: @ride[:pickup], | |
end: @ride[:destination], | |
current: @ride[:location] | |
}, | |
action: 'uber_notification', | |
message: text}) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment