class RailsBand::ActionCable::LogSubscriber

The custom LogSubscriber for ActionCable.

Public Instance Methods

broadcast(event) click to toggle source
# File lib/rails_band/action_cable/log_subscriber.rb, line 31
def broadcast(event)
  consumer_of(__method__)&.call(Event::Broadcast.new(event))
end
perform_action(event) click to toggle source
# File lib/rails_band/action_cable/log_subscriber.rb, line 15
def perform_action(event)
  consumer_of(__method__)&.call(Event::PerformAction.new(event))
end
transmit(event) click to toggle source
# File lib/rails_band/action_cable/log_subscriber.rb, line 19
def transmit(event)
  consumer_of(__method__)&.call(Event::Transmit.new(event))
end
transmit_subscription_confirmation(event) click to toggle source
# File lib/rails_band/action_cable/log_subscriber.rb, line 23
def transmit_subscription_confirmation(event)
  consumer_of(__method__)&.call(Event::TransmitSubscriptionConfirmation.new(event))
end
transmit_subscription_rejection(event) click to toggle source
# File lib/rails_band/action_cable/log_subscriber.rb, line 27
def transmit_subscription_rejection(event)
  consumer_of(__method__)&.call(Event::TransmitSubscriptionRejection.new(event))
end

Private Instance Methods

consumer_of(sub_event) click to toggle source
# File lib/rails_band/action_cable/log_subscriber.rb, line 37
def consumer_of(sub_event)
  consumers[:"#{sub_event}.action_cable"] || consumers[:action_cable] || consumers[:default]
end