Sha256: 298615817ab4fde2b3fdaecbd736a33adf5734b9926e18d4076b6bae57e584a9

Contents?: true

Size: 1.61 KB

Versions: 8

Compression:

Stored size: 1.61 KB

Contents

require 'eventmachine'
require 'websocket/driver'

require 'ably/modules/event_emitter'

require 'ably/realtime/auth'
require 'ably/realtime/channel'
require 'ably/realtime/channels'
require 'ably/realtime/client'
require 'ably/realtime/connection'
require 'ably/realtime/presence'

Dir.glob(File.expand_path("models/*.rb", File.dirname(__FILE__))).each do |file|
  require file
end

Dir.glob(File.expand_path("realtime/models/*.rb", File.dirname(__FILE__))).each do |file|
  require file
end

require 'ably/models/message_encoders/base'

require 'ably/realtime/client/incoming_message_dispatcher'
require 'ably/realtime/client/outgoing_message_dispatcher'

module Ably
  # 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"
  #
  module Realtime
    # 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')
    #
    def self.new(options)
      Ably::Realtime::Client.new(options)
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
ably-0.8.7 lib/ably/realtime.rb
ably-0.8.6 lib/ably/realtime.rb
ably-rest-0.8.6 lib/submodules/ably-ruby/lib/ably/realtime.rb
ably-rest-0.8.5 lib/submodules/ably-ruby/lib/ably/realtime.rb
ably-0.8.5 lib/ably/realtime.rb
ably-0.8.4 lib/ably/realtime.rb
ably-rest-0.8.3 lib/submodules/ably-ruby/lib/ably/realtime.rb
ably-0.8.3 lib/ably/realtime.rb