module ActionCable::Channel::Callbacks::ClassMethods
Public Instance Methods
This callback will be triggered after the Base#subscribed
method is called, even if the subscription was rejected with the Base#reject
method.
To trigger the callback only on successful subscriptions, use the Base#subscription_rejected?
method:
after_subscribe :my_method, unless: :subscription_rejected?
# File actioncable/lib/action_cable/channel/callbacks.rb, line 60 def after_subscribe(*methods, &block) set_callback(:subscribe, :after, *methods, &block) end
Also aliased as: on_subscribe
# File actioncable/lib/action_cable/channel/callbacks.rb, line 69 def after_unsubscribe(*methods, &block) set_callback(:unsubscribe, :after, *methods, &block) end
Also aliased as: on_unsubscribe
# File actioncable/lib/action_cable/channel/callbacks.rb, line 48 def before_subscribe(*methods, &block) set_callback(:subscribe, :before, *methods, &block) end
# File actioncable/lib/action_cable/channel/callbacks.rb, line 65 def before_unsubscribe(*methods, &block) set_callback(:unsubscribe, :before, *methods, &block) end