From c729a5abc70d8a40bf886c66694f82740b214fa2 Mon Sep 17 00:00:00 2001 From: sacOO7 Date: Wed, 15 May 2024 16:52:41 +0530 Subject: [PATCH] refactored and renamed provided clientOptions as a part of client initialize method --- lib/ably/realtime/channel.rb | 2 +- lib/ably/realtime/client.rb | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/ably/realtime/channel.rb b/lib/ably/realtime/channel.rb index 5f6cba49c..65b0ddfc5 100644 --- a/lib/ably/realtime/channel.rb +++ b/lib/ably/realtime/channel.rb @@ -42,7 +42,7 @@ class Channel # # @spec RTL2b # - # The permited states for this channel + # The permitted states for this channel STATE = ruby_enum('STATE', :initialized, :attaching, diff --git a/lib/ably/realtime/client.rb b/lib/ably/realtime/client.rb index bf04776c2..e603f766d 100644 --- a/lib/ably/realtime/client.rb +++ b/lib/ably/realtime/client.rb @@ -120,10 +120,10 @@ def initialize(options) acc[key.to_s] = value.to_s end @rest_client = Ably::Rest::Client.new(options.merge(realtime_client: self)) - @echo_messages = rest_client.options.fetch(:echo_messages, true) == false ? false : true - @queue_messages = rest_client.options.fetch(:queue_messages, true) == false ? false : true + @echo_messages = rest_client.options.fetch(:echo_messages, true) + @queue_messages = rest_client.options.fetch(:queue_messages, true) @custom_realtime_host = rest_client.options[:realtime_host] || rest_client.options[:ws_host] - @auto_connect = rest_client.options.fetch(:auto_connect, true) == false ? false : true + @auto_connect = rest_client.options.fetch(:auto_connect, true) @recover = rest_client.options[:recover] raise ArgumentError, "Recovery key '#{recover}' is invalid" if recover && !recover.match(Connection::RECOVER_REGEX) @@ -131,6 +131,8 @@ def initialize(options) @auth = Ably::Realtime::Auth.new(self) @channels = Ably::Realtime::Channels.new(self) @connection = Ably::Realtime::Connection.new(self, options) + + end # Return a {Ably::Realtime::Channel Realtime Channel} for the given name