lib/submodules/ably-ruby/lib/ably/realtime/presence/members_map.rb in ably-rest-1.0.5 vs lib/submodules/ably-ruby/lib/ably/realtime/presence/members_map.rb in ably-rest-1.0.6

- old
+ new

@@ -92,11 +92,11 @@ # def get(options = {}, &block) wait_for_sync = options.fetch(:wait_for_sync, true) deferrable = Ably::Util::SafeDeferrable.new(logger) - result_block = proc do + result_block = lambda do present_members.tap do |members| members.keep_if { |member| member.connection_id == options[:connection_id] } if options[:connection_id] members.keep_if { |member| member.client_id == options[:client_id] } if options[:client_id] end.tap do |members| safe_yield block, members if block_given? @@ -108,20 +108,20 @@ result_block.call else # Must be defined before subsequent procs reference this callback reset_callbacks = nil - in_sync_callback = proc do - reset_callbacks + in_sync_callback = lambda do + reset_callbacks.call if reset_callbacks result_block.call end - failed_callback = proc do |error| - reset_callbacks + failed_callback = lambda do |error| + reset_callbacks.call if reset_callbacks deferrable.fail error end - reset_callbacks = proc do + reset_callbacks = lambda do off(&in_sync_callback) off(&failed_callback) channel.off(&failed_callback) end