lib/ably/realtime/channel.rb in ably-0.8.4 vs lib/ably/realtime/channel.rb in ably-0.8.5
- old
+ new
@@ -132,11 +132,11 @@
#
# channel.publish('click', 'body') do |message|
# puts "#{message.name} event received with #{message.data}"
# end
#
- # channel.publish('click', 'body').errback do |message, error|
+ # channel.publish('click', 'body').errback do |error, message|
# puts "#{message.name} was not received, error #{error.message}"
# end
#
def publish(name, data = nil, attributes = {}, &success_block)
raise Ably::Exceptions::ChannelInactive.new('Cannot publish messages on a detached channel') if detached? || detaching?
@@ -153,10 +153,10 @@
ensure_supported_payload data
[{ name: name, data: data }.merge(attributes)]
end
queue_messages(messages).tap do |deferrable|
- deferrable.callback &success_block if block_given?
+ deferrable.callback(&success_block) if block_given?
end
end
# Subscribe to messages matching providing event name, or all messages if event name not provided.
#