Sha256: 9c81390572c85094b533ee9adafae1b9e7f8706986a9e98a027db86f0bf747ec

Contents?: true

Size: 752 Bytes

Versions: 14

Compression:

Stored size: 752 Bytes

Contents

require File.expand_path('../connection', __FILE__)
require File.expand_path('../request', __FILE__)
require File.expand_path('../configuration', __FILE__)
require File.expand_path('../endpoint', __FILE__)
require File.expand_path('../realtime/client', __FILE__)

module Slack
  # @private
  class API
    # @private
    attr_accessor(*Configuration::VALID_OPTIONS_KEYS)

    # Creates a new API
    def initialize(options={})
      options = Slack.options.merge(options)
      Configuration::VALID_OPTIONS_KEYS.each do |key|
        send("#{key}=", options[key])
      end
    end

    include Connection
    include Request
    include Endpoint

    def realtime
      url = post("rtm.start")["url"]
      RealTime::Client.new(url)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
slack-api-1.4.0 lib/slack/api.rb
slack-api-1.3.0 lib/slack/api.rb
slack-api-1.2.4 lib/slack/api.rb
slack-api-1.2.3 lib/slack/api.rb
slack-api-1.2.2 lib/slack/api.rb
slack-api-1.2.1 lib/slack/api.rb
slack-api-1.2.0 lib/slack/api.rb
slack-api-1.1.6 lib/slack/api.rb
slack-api-1.1.4 lib/slack/api.rb
slack-api-1.1.3 lib/slack/api.rb
slack-api-1.1.2 lib/slack/api.rb
slack-api-1.1.1 lib/slack/api.rb
slack-api-1.1.0 lib/slack/api.rb
slack-api-1.0.0 lib/slack/api.rb