diff options
Diffstat (limited to 'lib/action_cable/channel/callbacks.rb')
-rw-r--r-- | lib/action_cable/channel/callbacks.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/action_cable/channel/callbacks.rb b/lib/action_cable/channel/callbacks.rb index 9ca8896770..dcdd27b9a7 100644 --- a/lib/action_cable/channel/callbacks.rb +++ b/lib/action_cable/channel/callbacks.rb @@ -11,10 +11,14 @@ module ActionCable end module ClassMethods + # Name methods that should be called when the channel is subscribed to. + # (These methods should be private, so they're not callable by the user). def on_subscribe(*methods) self.on_subscribe_callbacks += methods end + # Name methods that should be called when the channel is unsubscribed from. + # (These methods should be private, so they're not callable by the user). def on_unsubscribe(*methods) self.on_unsubscribe_callbacks += methods end |