Class: ActionCable::Channel::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/anycable/actioncable/channel.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#stop_streamsObject (readonly)

Returns the value of attribute stop_streams.



15
16
17
# File 'lib/anycable/actioncable/channel.rb', line 15

def stop_streams
  @stop_streams
end

Instance Method Details

#delegate_connection_identifiersObject



34
35
36
37
38
39
40
# File 'lib/anycable/actioncable/channel.rb', line 34

def delegate_connection_identifiers
  connection.identifiers.each do |identifier|
    define_singleton_method(identifier) do
      connection.fetch_identifier(identifier)
    end
  end
end

#do_subscribeObject



7
# File 'lib/anycable/actioncable/channel.rb', line 7

alias do_subscribe subscribe_to_channel

#stop_all_streamsObject



22
23
24
# File 'lib/anycable/actioncable/channel.rb', line 22

def stop_all_streams
  @stop_streams = true
end

#stop_streams?Boolean

Returns:

  • (Boolean)


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

def stop_streams?
  stop_streams == true
end

#stream_from(broadcasting, callback = nil, coder: nil) ⇒ Object



17
18
19
20
# File 'lib/anycable/actioncable/channel.rb', line 17

def stream_from(broadcasting, callback = nil, coder: nil)
  raise ArgumentError('Unsupported') if callback.present? || coder.present? || block_given?
  streams << broadcasting
end

#streamsObject



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

def streams
  @streams ||= []
end

#subscribe_to_channelObject



11
12
13
# File 'lib/anycable/actioncable/channel.rb', line 11

def subscribe_to_channel
  # noop
end