From 294a277a8409e05c6b98cd8e46a8e0745f68b40d Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 20 Jun 2015 16:22:40 +0200 Subject: Rename broadcast to transmit for the connection/channel->subscriber communication MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Disambiguate it from the broadcast to channel method used by the broadcaster (which actually has several listeners, whereas a connection/channel instance only ever has one listener – hence not much of a BROADcast). --- lib/action_cable/channel/base.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/action_cable/channel/base.rb') diff --git a/lib/action_cable/channel/base.rb b/lib/action_cable/channel/base.rb index c39c2fcf0b..4c90849a06 100644 --- a/lib/action_cable/channel/base.rb +++ b/lib/action_cable/channel/base.rb @@ -79,10 +79,10 @@ module ActionCable end - def broadcast(data) + def transmit(data, via: nil) if authorized? - logger.info "#{channel_name} broadcasting #{data.inspect}" - connection.broadcast({ identifier: @channel_identifier, message: data }.to_json) + logger.info "#{channel_name} transmitting #{data.inspect} #{via}" + connection.transmit({ identifier: @channel_identifier, message: data }.to_json) else unauthorized end -- cgit v1.2.3