Class: Ably::Realtime::Models::NilChannel Private

Inherits:
Object
  • Object
show all
Extended by:
Modules::Enum
Includes:
Modules::EventEmitter, Modules::StateEmitter, Modules::UsesStateMachine
Defined in:
lib/ably/realtime/models/nil_channel.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.

Nil object for Channels, this object is only used within the internal API of this client library

Constant Summary collapse

STATE =

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

ruby_enum('STATE', Ably::Realtime::Channel::STATE)

Instance Attribute Summary collapse

Attributes included from Modules::UsesStateMachine

#previous_state, #state_history

Instance Method Summary collapse

Methods included from Modules::UsesStateMachine

#synchronize_state_with_statemachine, #transition_state_machine, #transition_state_machine!

Methods included from Modules::StateEmitter

#once_or_if, #once_state_changed, #state, #state=, #state?, #unsafe_once_or_if, #unsafe_once_state_changed

Methods included from Modules::EventEmitter

#emit, #off, #on, #once, #unsafe_off, #unsafe_on, #unsafe_once

Constructor Details

#initializeNilChannel

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.

Returns a new instance of NilChannel.



13
14
15
16
# File 'lib/ably/realtime/models/nil_channel.rb', line 13

def initialize
  @state_machine = Ably::Realtime::Channel::ChannelStateMachine.new(self)
  @state         = STATE(state_machine.current_state)
end

Instance Attribute Details

#state_machineObject (readonly)

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.



11
12
13
# File 'lib/ably/realtime/models/nil_channel.rb', line 11

def state_machine
  @state_machine
end

Instance Method Details

#__incoming_msgbus__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.



22
23
24
# File 'lib/ably/realtime/models/nil_channel.rb', line 22

def __incoming_msgbus__
  @__incoming_msgbus__ ||= Ably::Util::PubSub.new
end

#loggerObject

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.



26
27
28
# File 'lib/ably/realtime/models/nil_channel.rb', line 26

def logger
  @logger ||= Ably::Models::NilLogger.new
end

#nameObject

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.



18
19
20
# File 'lib/ably/realtime/models/nil_channel.rb', line 18

def name
  'Nil channel'
end