class UNotifier::Provider::System::ActionCable

Attributes

channel_name[RW]
server[R]

Public Class Methods

new(server, channel_name: nil, notification_conditions: []) click to toggle source
Calls superclass method UNotifier::Provider::ProviderBase::new
# File lib/provider/system/action_cable.rb, line 8
def initialize(server, channel_name: nil, notification_conditions: [])
  super(notification_conditions: notification_conditions)
  @server = server
  @channel_name = channel_name
end

Public Instance Methods

notify(notification, data) click to toggle source
# File lib/provider/system/action_cable.rb, line 14
def notify(notification, data)
  return unless can_notify?(notification)

  server.broadcast channel_name.call(notification), data
end
sensitive?() click to toggle source
# File lib/provider/system/action_cable.rb, line 20
def sensitive?
  false
end