Class: SignalingChannel
- Inherits:
-
ApplicationCable::Channel
- Object
- ActionCable::Channel::Base
- ApplicationCable::Channel
- SignalingChannel
- Defined in:
- lib/generators/sbmeet/templates/channels/signaling_channel.rb
Instance Method Summary collapse
Instance Method Details
#receive(data) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/generators/sbmeet/templates/channels/signaling_channel.rb', line 6 def receive(data) # Inject authenticated current_user context directly into outbound payloads data[:user_id] = current_user.id data[:user_name] = current_user.email.split('@').first.capitalize ActionCable.server.broadcast("signaling_room_#{data['room_id']}", data) end |
#subscribed ⇒ Object
2 3 4 |
# File 'lib/generators/sbmeet/templates/channels/signaling_channel.rb', line 2 def subscribed stream_from "signaling_room_#{params[:room_id]}" end |