lib/submodules/ably-ruby/lib/ably/rest/channel.rb in ably-rest-1.0.5 vs lib/submodules/ably-ruby/lib/ably/rest/channel.rb in ably-rest-1.0.6
- old
+ new
@@ -20,11 +20,11 @@
# @param name [String] The name of the channel
# @param channel_options [Hash] Channel options, currently reserved for Encryption 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
+ name = (ensure_utf_8 :name, name)
update_options channel_options
@client = client
@name = name
end
@@ -56,10 +56,10 @@
#
def publish(name, data = nil, attributes = {})
messages = if name.kind_of?(Enumerable)
name
else
- ensure_utf_8 :name, name, allow_nil: true
+ name = ensure_utf_8(:name, name, allow_nil: true)
ensure_supported_payload data
[{ name: name, data: data }.merge(attributes)]
end
payload = messages.map do |message|