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 50

def initialize(identifiers = {})
  @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

#identifiers (readonly)

[ GitHub ]

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

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

#logger (readonly)

[ GitHub ]

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

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

#subscriptions (readonly)

[ GitHub ]

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

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

#transmissions (readonly)

[ GitHub ]

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

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

Instance Method Details

#transmit(cable_message)

[ GitHub ]

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

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