Module: ActionCable::Channel::Callbacks::ClassMethods

Defined in:
actioncable/lib/action_cable/channel/callbacks.rb

Instance Method Summary collapse

Instance Method Details

#after_subscribe(*methods, &block) ⇒ Object Also known as: on_subscribe



21
22
23
# File 'actioncable/lib/action_cable/channel/callbacks.rb', line 21

def after_subscribe(*methods, &block)
  set_callback(:subscribe, :after, *methods, &block)
end

#after_unsubscribe(*methods, &block) ⇒ Object Also known as: on_unsubscribe



30
31
32
# File 'actioncable/lib/action_cable/channel/callbacks.rb', line 30

def after_unsubscribe(*methods, &block)
  set_callback(:unsubscribe, :after, *methods, &block)
end

#before_subscribe(*methods, &block) ⇒ Object



17
18
19
# File 'actioncable/lib/action_cable/channel/callbacks.rb', line 17

def before_subscribe(*methods, &block)
  set_callback(:subscribe, :before, *methods, &block)
end

#before_unsubscribe(*methods, &block) ⇒ Object



26
27
28
# File 'actioncable/lib/action_cable/channel/callbacks.rb', line 26

def before_unsubscribe(*methods, &block)
  set_callback(:unsubscribe, :before, *methods, &block)
end