Class: Ably::Realtime::Channel::ChannelStateMachine Private

Inherits:
Object
  • Object
show all
Includes:
Modules::StateMachine
Defined in:
lib/ably/realtime/channel/channel_state_machine.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Internal class to manage channel state for Ably::Realtime::Channel

Class Method Summary collapse

Methods included from Modules::StateMachine

#exception_for_state_change_to, included, #previous_state, #previous_transition, #transition_state

Class Method Details

.error_from_state_change(current_transition) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



75
76
77
78
79
80
81
# File 'lib/ably/realtime/channel/channel_state_machine.rb', line 75

def self.error_from_state_change(current_transition)
  # ChannelStateChange object is always passed in current_transition metadata object
  connection_state_change = current_transition.
  # Reason attribute contains errors
  err = connection_state_change && connection_state_change.reason
  err if is_error_type?(err)
end