Module: ActionCable::Channel::Callbacks::ClassMethods
| Relationships & Source Files | |
| Defined in: | actioncable/lib/action_cable/channel/callbacks.rb | 
Instance Method Summary
- 
    
      #after_subscribe(*methods, &block)  
      (also: #on_subscribe)
    
    
This callback will be triggered after the Base#subscribed method is called, even if the subscription was rejected with the Base#reject method.
 - #after_unsubscribe(*methods, &block) (also: #on_unsubscribe)
 - #before_subscribe(*methods, &block)
 - #before_unsubscribe(*methods, &block)
 - 
    
      #on_subscribe(*methods, &block)  
    
    
Alias for #after_subscribe.
 - 
    
      #on_unsubscribe(*methods, &block)  
    
    
Alias for #after_unsubscribe.
 - #internal_methods private
 
Instance Method Details
#after_subscribe(*methods, &block) Also known as: #on_subscribe
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 62
def after_subscribe(*methods, &block) set_callback(:subscribe, :after, *methods, &block) end
#after_unsubscribe(*methods, &block) Also known as: #on_unsubscribe
[ GitHub ]# File 'actioncable/lib/action_cable/channel/callbacks.rb', line 71
def after_unsubscribe(*methods, &block) set_callback(:unsubscribe, :after, *methods, &block) end
#before_subscribe(*methods, &block)
[ GitHub ]# File 'actioncable/lib/action_cable/channel/callbacks.rb', line 50
def before_subscribe(*methods, &block) set_callback(:subscribe, :before, *methods, &block) end
#before_unsubscribe(*methods, &block)
[ GitHub ]# File 'actioncable/lib/action_cable/channel/callbacks.rb', line 67
def before_unsubscribe(*methods, &block) set_callback(:unsubscribe, :before, *methods, &block) end
#internal_methods (private)
[ GitHub ]# File 'actioncable/lib/action_cable/channel/callbacks.rb', line 77
def internal_methods INTERNAL_METHODS end
#on_subscribe(*methods, &block)
Alias for #after_subscribe.
# File 'actioncable/lib/action_cable/channel/callbacks.rb', line 65
alias_method :on_subscribe, :after_subscribe
#on_unsubscribe(*methods, &block)
Alias for #after_unsubscribe.
# File 'actioncable/lib/action_cable/channel/callbacks.rb', line 74
alias_method :on_unsubscribe, :after_unsubscribe