class ActionCable::Channel::Base

Public Instance Methods

subscribe_to_channel() click to toggle source
# File lib/lograge/rails_ext/action_cable/channel/base.rb, line 4
def subscribe_to_channel
  ActiveSupport::Notifications.instrument('subscribe.action_cable', notification_payload('subscribe')) do
    run_callbacks :subscribe do
      subscribed
    end

    reject_subscription if subscription_rejected?
    ensure_confirmation_sent
  end
end
unsubscribe_from_channel() click to toggle source
# File lib/lograge/rails_ext/action_cable/channel/base.rb, line 15
def unsubscribe_from_channel
  ActiveSupport::Notifications.instrument('unsubscribe.action_cable', notification_payload('unsubscribe')) do
    run_callbacks :unsubscribe do
      unsubscribed
    end
  end
end

Private Instance Methods

notification_payload(method_name) click to toggle source
# File lib/lograge/rails_ext/action_cable/channel/base.rb, line 25
def notification_payload(method_name)
  { channel_class: self.class.name, action: method_name }
end