Sha256: df4ed525e9a1d51e1c4f31ab37063b53e2dd2328ba9492e5e43153db3136b524

Contents?: true

Size: 1.58 KB

Versions: 5

Compression:

Stored size: 1.58 KB

Contents

require 'eventmachine'
require 'websocket/driver'

require 'ably/modules/event_emitter'

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

5 entries across 5 versions & 2 rubygems

Version Path
ably-rest-0.8.2 lib/submodules/ably-ruby/lib/ably/realtime.rb
ably-0.8.2 lib/ably/realtime.rb
ably-0.8.1 lib/ably/realtime.rb
ably-rest-0.8.1 lib/submodules/ably-ruby/lib/ably/realtime.rb
ably-0.8.0 lib/ably/realtime.rb