Class: Noticed::DeliveryMethods::ActionCable

Inherits:
Noticed::DeliveryMethod show all
Defined in:
lib/noticed/delivery_methods/action_cable.rb

Instance Attribute Summary

Attributes inherited from Noticed::DeliveryMethod

#config, #event, #notification

Instance Method Summary collapse

Methods inherited from Noticed::DeliveryMethod

#evaluate_option, #fetch_constant, #perform

Methods included from ApiClient

#post_request

Instance Method Details

#deliverObject



6
7
8
9
10
11
12
# File 'lib/noticed/delivery_methods/action_cable.rb', line 6

def deliver
  channel = fetch_constant(:channel) || Noticed::NotificationChannel
  stream = evaluate_option(:stream) || recipient
  message = evaluate_option(:message)

  channel.broadcast_to stream, message
end