class ActionCable::Channel::ConnectionStub
Attributes
Public Class Methods
Source
# File 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
Public Instance Methods
Source
# File lib/action_cable/channel/test_case.rb, line 66 def connection_identifier @connection_identifier ||= connection_gid(identifiers.filter_map { |id| send(id.to_sym) if id }) end
Source
# File lib/action_cable/channel/test_case.rb, line 62 def transmit(cable_message) transmissions << cable_message.with_indifferent_access end
Private Instance Methods
Source
# File lib/action_cable/channel/test_case.rb, line 71 def connection_gid(ids) ids.map do |o| if o.respond_to?(:to_gid_param) o.to_gid_param else o.to_s end end.sort.join(":") end