lib/submodules/ably-ruby/lib/ably/realtime/channel.rb in ably-rest-0.8.6 vs lib/submodules/ably-ruby/lib/ably/realtime/channel.rb in ably-rest-0.8.9
- old
+ new
@@ -80,12 +80,11 @@
# Initialize a new Channel object
#
# @param client [Ably::Rest::Client]
# @param name [String] The name of the channel
# @param channel_options [Hash] Channel options, currently reserved for Encryption options
- # @option channel_options [Boolean] :encrypted setting this to true for this channel will encrypt & decrypt all messages automatically
- # @option channel_options [Hash] :cipher_params A hash of options to configure the encryption. *:key* is required, all other options are optional. See {Ably::Util::Crypto#initialize} for a list of +cipher_params+ options
+ # @option channel_options [Hash,Ably::Models::CipherParams] :cipher A hash of options or a {Ably::Models::CipherParams} to configure the encryption. *:key* is required, all other options are optional. See {Ably::Util::Crypto#initialize} for a list of +:cipher+ options
#
def initialize(client, name, channel_options = {})
ensure_utf_8 :name, name
update_options channel_options
@@ -292,11 +291,13 @@
# As we are using a state machine, do not allow change_state to be used
# #transition_state_machine must be used instead
private :change_state
private
- attr_reader :queue
+ def queue
+ @queue
+ end
def setup_event_handlers
__incoming_msgbus__.subscribe(:message) do |message|
message.decode self
emit_message message.name, message
@@ -321,11 +322,11 @@
raise Ably::Exceptions::IncompatibleClientId.new("Cannot publish with client_id '#{message.client_id}' as it is incompatible with the current configured client_id '#{client.client_id}'", 400, 40012)
end
end
end
- queue.push *messages
+ queue.push(*messages)
if attached?
process_queue
else
attach
@@ -383,11 +384,11 @@
messages: messages
)
end
def create_message(message)
- Ably::Models::Message(message.dup).tap do |message|
- message.encode self
+ Ably::Models::Message(message.dup).tap do |msg|
+ msg.encode self
end
end
def rest_channel
client.rest_client.channel(name)