Class: Slack::Client

Inherits:
Object
  • Object
show all
Includes:
Web
Defined in:
lib/slack/client.rb

Overview

Use this class to make Slack API calls. You'll need to obtain an OAuth 2 access token

Constant Summary

Constants included from Web::Users

Web::Users::SCOPE

Constants included from Web::Team

Web::Team::SCOPE

Constants included from Web::Search

Web::Search::SCOPE

Constants included from Web::Stars

Web::Stars::SCOPE

Constants included from Web::Im

Web::Im::SCOPE

Constants included from Web::Groups

Web::Groups::SCOPE

Constants included from Web::Files

Web::Files::SCOPE

Constants included from Web::Emoji

Web::Emoji::SCOPE

Constants included from Web::Chat

Web::Chat::SCOPE

Constants included from Web::Channels

Web::Channels::SCOPE

Constants included from Web::Auth

Web::Auth::SCOPE

Constants included from Web::Api

Web::Api::SCOPE

Instance Method Summary collapse

Methods included from Web::Users

#users_get_presence, #users_info, #users_list, #users_set_active, #users_set_presence

Methods included from Web::Team

#team_access_logs, #team_info

Methods included from Web::Search

#search_all, #search_files, #search_messages

Methods included from Web::Stars

#stars_add, #stars_list, #stars_remove

Methods included from Web::Im

#im_close, #im_history, #im_list, #im_mark, #im_open

Methods included from Web::Groups

#groups_archive, #groups_close, #groups_create, #groups_create_child, #groups_history, #groups_info, #groups_invite, #groups_kick, #groups_leave, #groups_list, #groups_mark, #groups_open, #groups_rename, #groups_set_purpose, #groups_set_topic, #groups_unarchive

Methods included from Web::Files

#files_delete, #files_info, #files_list, #files_upload

Methods included from Web::Emoji

#emoji_list

Methods included from Web::Chat

#chat_delete, #chat_post_message, #chat_update

Methods included from Web::Channels

#channels_archive, #channels_create, #channels_history, #channels_info, #channels_invite, #channels_join, #channels_kick, #channels_leave, #channels_list, #channels_mark, #channels_rename, #channels_set_purpose, #channels_set_topic, #channels_unarchive

Methods included from Web::Auth

#auth_test

Methods included from Web::Api

#api_test

Constructor Details

#initialize(oauth2_access_token) ⇒ Client

Returns a new instance of Client.

Parameters:

  • oauth2_access_token (String)

    user token



14
15
16
17
18
19
# File 'lib/slack/client.rb', line 14

def initialize(oauth2_access_token)
  unless oauth2_access_token.is_a?(String)
    fail ArgumentError, 'bad type for oauth2_access_token (expecting String)'
  end
  @session = Session.new(oauth2_access_token)
end