lib/ably/realtime/models/nil_channel.rb in ably-0.6.2 vs lib/ably/realtime/models/nil_channel.rb in ably-0.7.0
- old
+ new
@@ -1,21 +1,30 @@
module Ably::Realtime::Models
# Nil object for Channels, this object is only used within the internal API of this client library
+ # @api private
class NilChannel
include Ably::Modules::EventEmitter
extend Ably::Modules::Enum
STATE = ruby_enum('STATE', Ably::Realtime::Channel::STATE)
include Ably::Modules::StateEmitter
+ include Ably::Modules::UsesStateMachine
+ attr_reader :state_machine
+
def initialize
- @state = STATE.Initialized
+ @state_machine = Ably::Realtime::Channel::ChannelStateMachine.new(self)
+ @state = STATE(state_machine.current_state)
end
def name
'Nil channel'
end
def __incoming_msgbus__
@__incoming_msgbus__ ||= Ably::Util::PubSub.new
+ end
+
+ def logger
+ @logger ||= Ably::Models::NilLogger.new
end
end
end