Class: ApplicationCable::Channel

Inherits:
ActionCable::Channel::Base
  • Object
show all
Defined in:
app/channels/application_cable/channel.rb

Overview

Action Cable base channel.

Direct Known Subclasses

SwitchboardChannel

Instance Method Summary collapse

Instance Method Details

#rendererActionController::Renderer

This method will return ApplicationController.renderer with our
Warden::Proxy instance added to the default environment hash.

Returns:

  • (ActionController::Renderer)

    the renderer with Warden env merged in



19
20
21
22
23
24
25
# File 'app/channels/application_cable/channel.rb', line 19

def renderer
  ApplicationController.renderer.tap do |default_renderer|
    default_env = default_renderer.instance_variable_get(:@env)
    env_with_warden = default_env.merge('warden' => connection.warden)
    default_renderer.instance_variable_set(:@env, env_with_warden)
  end
end

#subscribedvoid

This method returns an undefined value.

Streams updates to the current account when the client subscribes.



11
12
13
# File 'app/channels/application_cable/channel.rb', line 11

def subscribed
  stream_for 
end