Class: ActionCable::Channel::ConnectionStub
Relationships & Source Files | |
Inherits: | Object |
Defined in: | actioncable/lib/action_cable/channel/test_case.rb |
Class Method Summary
- .new(identifiers = {}) ⇒ ConnectionStub constructor
Instance Attribute Summary
- #identifiers readonly
- #logger readonly
- #subscriptions readonly
- #transmissions readonly
Instance Method Summary
Constructor Details
.new(identifiers = {}) ⇒ ConnectionStub
# 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( ) transmissions << .with_indifferent_access end