Skip to content

Commit

Permalink
refactored and renamed provided clientOptions as a part of client
Browse files Browse the repository at this point in the history
initialize method
  • Loading branch information
sacOO7 committed May 15, 2024
1 parent 34bfde6 commit c729a5a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/ably/realtime/channel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 5 additions & 3 deletions lib/ably/realtime/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,19 @@ 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)

@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
Expand Down

0 comments on commit c729a5a

Please sign in to comment.