lib/ably/realtime/channels.rb in ably-1.2.4 vs lib/ably/realtime/channels.rb in ably-1.2.6

- old
+ new

@@ -44,8 +44,28 @@ def release(channel) get(channel).detach do @channels.delete(channel) end if @channels.has_key?(channel) end + + # Sets channel serial to each channel from given serials hashmap + # @param [Hash] serials - map of channel name to respective channel serial + # @api private + def set_channel_serials(serials) + serials.each do |channel_name, channel_serial| + get(channel_name).properties.channel_serial = channel_serial + end + end + + # @return [Hash] serials - map of channel name to respective channel serial + # @api private + def get_channel_serials + channel_serials = {} + self.each do |channel| + channel_serials[channel.name] = channel.properties.channel_serial if channel.state == :attached + end + channel_serials + end + end end end