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

#channelObject



10
11
12
# File 'lib/noticed/delivery_methods/action_cable.rb', line 10

def channel
  fetch_constant(:channel) || Noticed::NotificationChannel
end

#deliverObject



6
7
8
# File 'lib/noticed/delivery_methods/action_cable.rb', line 6

def deliver
  channel.broadcast_to stream, evaluate_option(:message)
end

#streamObject



14
15
16
# File 'lib/noticed/delivery_methods/action_cable.rb', line 14

def stream
  evaluate_option(:stream) || recipient
end