Class: Noticed::NotificationChannel
- Inherits:
-
ApplicationCable::Channel
- Object
- ApplicationCable::Channel
- Noticed::NotificationChannel
- Defined in:
- lib/noticed/notification_channel.rb
Instance Method Summary collapse
- #mark_as_read(data) ⇒ Object
- #mark_as_seen(data) ⇒ Object
- #subscribed ⇒ Object
- #unsubscribed ⇒ Object
Instance Method Details
#mark_as_read(data) ⇒ Object
15 16 17 |
# File 'lib/noticed/notification_channel.rb', line 15 def mark_as_read(data) current_user.notifications.where(id: data["ids"]).mark_as_read end |
#mark_as_seen(data) ⇒ Object
11 12 13 |
# File 'lib/noticed/notification_channel.rb', line 11 def mark_as_seen(data) current_user.notifications.where(id: data["ids"]).mark_as_seen end |
#subscribed ⇒ Object
3 4 5 |
# File 'lib/noticed/notification_channel.rb', line 3 def subscribed stream_for current_user end |
#unsubscribed ⇒ Object
7 8 9 |
# File 'lib/noticed/notification_channel.rb', line 7 def unsubscribed stop_all_streams end |