module Ably::Realtime

Realtime provides the top-level class to be instanced for the Ably Realtime library

@example

client = Ably::Realtime.new("xxxxx")
channel = client.channel("test")
channel.subscribe do |message|
  message[:name] #=> "greeting"
end
channel.publish "greeting", "data"

Public Class Methods

new(options) click to toggle source

Convenience method providing an alias to {Ably::Realtime::Client} constructor.

@param (see Ably::Realtime::Client#initialize) @option options (see Ably::Realtime::Client#initialize)

@return [Ably::Realtime::Client]

@example

# create a new client authenticating with basic auth
client = Ably::Realtime.new('key.id:secret')

# create a new client authenticating with basic auth and a client_id
client = Ably::Realtime.new(key: 'key.id:secret', client_id: 'john')
# File lib/submodules/ably-ruby/lib/ably/realtime.rb, line 56
def self.new(options)
  Ably::Realtime::Client.new(options)
end