lib/ably/modules/state_emitter.rb in ably-0.8.4 vs lib/ably/modules/state_emitter.rb in ably-0.8.5

- old
+ new

@@ -140,10 +140,10 @@ # If the state changes to any other state, the {Ably::Util::SafeDeferrable#errback} is called. # def deferrable_for_state_change_to(target_state) Ably::Util::SafeDeferrable.new(logger).tap do |deferrable| fail_proc = Proc.new do |state_change| - deferrable.fail self, state_change.reason + deferrable.fail state_change.reason end once_or_if(target_state, else: fail_proc) do yield self if block_given? deferrable.succeed self end