class Noticed::DeliveryMethods::ActionCable

Public Instance Methods

deliver() click to toggle source
# File lib/noticed/delivery_methods/action_cable.rb, line 4
def deliver
  channel.broadcast_to recipient, format
end

Private Instance Methods

channel() click to toggle source
# File lib/noticed/delivery_methods/action_cable.rb, line 18
def channel
  @channel ||= begin
    value = options[:channel]
    case value
    when String
      value.constantize
    when Symbol
      notification.send(value)
    when Class
      value
    else
      Noticed::NotificationChannel
    end
  end
end
format() click to toggle source
# File lib/noticed/delivery_methods/action_cable.rb, line 10
def format
  if (method = options[:format])
    notification.send(method)
  else
    notification.params
  end
end