123456789_123456789_123456789_123456789_123456789_

Class: ActionCable::Channel::ConnectionStub

Relationships & Source Files
Inherits: Object
Defined in: actioncable/lib/action_cable/channel/test_case.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(identifiers = {}) ⇒ ConnectionStub

[ GitHub ]

  
# File 'actioncable/lib/action_cable/channel/test_case.rb', line 54

def initialize(identifiers = {})
  @server = ActionCable.server
  @transmissions = []

  identifiers.each do |identifier, val|
    define_singleton_method(identifier) { val }
  end

  @subscriptions = ActionCable::Connection::Subscriptions.new(self)
  @identifiers = identifiers.keys
  @logger = ActiveSupport::TaggedLogging.new ActiveSupport::Logger.new(StringIO.new)
end

Instance Attribute Details

#config (readonly)

[ GitHub ]

  
# File 'actioncable/lib/action_cable/channel/test_case.rb', line 52

delegate :pubsub, :config, to: :server

#identifiers (readonly)

[ GitHub ]

  
# File 'actioncable/lib/action_cable/channel/test_case.rb', line 50

attr_reader :server, :transmissions, :identifiers, :subscriptions, :logger

#logger (readonly)

[ GitHub ]

  
# File 'actioncable/lib/action_cable/channel/test_case.rb', line 50

attr_reader :server, :transmissions, :identifiers, :subscriptions, :logger

#pubsub (readonly)

[ GitHub ]

  
# File 'actioncable/lib/action_cable/channel/test_case.rb', line 52

delegate :pubsub, :config, to: :server

#server (readonly)

[ GitHub ]

  
# File 'actioncable/lib/action_cable/channel/test_case.rb', line 50

attr_reader :server, :transmissions, :identifiers, :subscriptions, :logger

#subscriptions (readonly)

[ GitHub ]

  
# File 'actioncable/lib/action_cable/channel/test_case.rb', line 50

attr_reader :server, :transmissions, :identifiers, :subscriptions, :logger

#transmissions (readonly)

[ GitHub ]

  
# File 'actioncable/lib/action_cable/channel/test_case.rb', line 50

attr_reader :server, :transmissions, :identifiers, :subscriptions, :logger

Instance Method Details

#connection_identifier

[ GitHub ]

  
# File 'actioncable/lib/action_cable/channel/test_case.rb', line 71

def connection_identifier
  @connection_identifier ||= connection_gid(identifiers.filter_map { |id| send(id.to_sym) if id })
end

#transmit(cable_message)

[ GitHub ]

  
# File 'actioncable/lib/action_cable/channel/test_case.rb', line 67

def transmit(cable_message)
  transmissions << cable_message.with_indifferent_access
end