Class: Loco::NotificationCenterChannel
- Inherits:
-
ApplicationCable::Channel
- Object
- ApplicationCable::Channel
- Loco::NotificationCenterChannel
- Defined in:
- app/channels/loco/notification_center_channel.rb
Instance Method Summary collapse
Instance Method Details
#receive(data) ⇒ Object
19 20 21 22 |
# File 'app/channels/loco/notification_center_channel.rb', line 19 def receive data update_connections if data['loco'] && data['loco']['connection_check'] NotificationCenter.new.received_signal , data end |
#subscribed ⇒ Object
5 6 7 8 9 10 |
# File 'app/channels/loco/notification_center_channel.rb', line 5 def subscribed return unless .is_a?(Array) stream_for_resources return if .compact.size > 1 SenderJob.perform_later @uuid, loco: { start_ajax_polling: true } end |
#unsubscribed ⇒ Object
12 13 14 15 16 17 |
# File 'app/channels/loco/notification_center_channel.rb', line 12 def unsubscribed .each do |resource| next if resource.nil? || resource.is_a?(String) UuidJob.perform_later serialize_resource(resource), @uuid, 'del' end end |