Class: ActionCable::Channel::Base
- Inherits:
-
Object
- Object
- ActionCable::Channel::Base
- Defined in:
- lib/anycable/actioncable/channel.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#stop_streams ⇒ Object
readonly
Returns the value of attribute stop_streams.
Instance Method Summary collapse
- #delegate_connection_identifiers ⇒ Object
- #do_subscribe ⇒ Object
- #stop_all_streams ⇒ Object
- #stop_streams? ⇒ Boolean
- #stream_from(broadcasting, callback = nil, coder: nil) ⇒ Object
- #streams ⇒ Object
- #subscribe_to_channel ⇒ Object
Instance Attribute Details
#stop_streams ⇒ Object (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_identifiers ⇒ Object
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_subscribe ⇒ Object
7 |
# File 'lib/anycable/actioncable/channel.rb', line 7 alias do_subscribe subscribe_to_channel |
#stop_all_streams ⇒ Object
22 23 24 |
# File 'lib/anycable/actioncable/channel.rb', line 22 def stop_all_streams @stop_streams = true end |
#stop_streams? ⇒ 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 |
#streams ⇒ Object
26 27 28 |
# File 'lib/anycable/actioncable/channel.rb', line 26 def streams @streams ||= [] end |
#subscribe_to_channel ⇒ Object
11 12 13 |
# File 'lib/anycable/actioncable/channel.rb', line 11 def subscribe_to_channel # noop end |