lib/submodules/ably-ruby/lib/ably/realtime/channel.rb in ably-rest-0.8.1 vs lib/submodules/ably-ruby/lib/ably/realtime/channel.rb in ably-rest-0.8.2
- old
+ new
@@ -120,10 +120,11 @@
# puts "#{message.name} was not received, error #{error.message}"
# end
#
def publish(name, data, &success_block)
ensure_utf_8 :name, name
+ ensure_supported_payload data
create_message(name, data).tap do |message|
message.callback(&success_block) if block_given?
queue_message message
end
@@ -179,16 +180,13 @@
# Presence object for this Channel. This controls this client's
# presence on the channel and may also be used to obtain presence information
# and change events for other members of the channel.
#
- # When accessing presence, if the channel is not attached, the channel is implicitly attached
- #
# @return {Ably::Realtime::Presence}
#
def presence
- attach if initialized?
@presence
end
# Return the message history of the channel
#
@@ -198,10 +196,10 @@
#
# @param (see Ably::Rest::Channel#history)
# @option options (see Ably::Rest::Channel#history)
# @option options [Boolean] :until_attach When true, the history request will be limited only to messages published before this channel was attached. Channel must be attached
#
- # @yield [Ably::Models::PaginatedResource<Ably::Models::Message>] First {Ably::Models::PaginatedResource page} of {Ably::Models::Message} objects accessible with {Ably::Models::PaginatedResource#items #items}.
+ # @yield [Ably::Models::PaginatedResult<Ably::Models::Message>] First {Ably::Models::PaginatedResult page} of {Ably::Models::Message} objects accessible with {Ably::Models::PaginatedResult#items #items}.
#
# @return [Ably::Util::SafeDeferrable]
#
def history(options = {}, &callback)
if options.delete(:until_attach)