Class: KHL::HTTP::Client
- Inherits:
-
Object
- Object
- KHL::HTTP::Client
- Defined in:
- lib/khl/http/client.rb
Overview
Client for the KHL HTTP API client = KHL::HTTP::Client.new(token: “bot_token”) client.guild.list # Call guild/list API
Instance Attribute Summary collapse
-
#asset ⇒ Object
readonly
Returns the value of attribute asset.
-
#badge ⇒ Object
readonly
Returns the value of attribute badge.
-
#blacklist ⇒ Object
readonly
Returns the value of attribute blacklist.
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
-
#channel_role ⇒ Object
readonly
Returns the value of attribute channel_role.
-
#channel_user ⇒ Object
readonly
Returns the value of attribute channel_user.
-
#direct_message ⇒ Object
readonly
Returns the value of attribute direct_message.
-
#game ⇒ Object
readonly
Returns the value of attribute game.
-
#gateway ⇒ Object
readonly
Returns the value of attribute gateway.
-
#guild ⇒ Object
readonly
Returns the value of attribute guild.
-
#guild_emoji ⇒ Object
readonly
Returns the value of attribute guild_emoji.
-
#guild_mute ⇒ Object
readonly
Returns the value of attribute guild_mute.
-
#guild_role ⇒ Object
readonly
Returns the value of attribute guild_role.
-
#intimacy ⇒ Object
readonly
Returns the value of attribute intimacy.
-
#invite ⇒ Object
readonly
Returns the value of attribute invite.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
-
#user_chat ⇒ Object
readonly
Returns the value of attribute user_chat.
Instance Method Summary collapse
-
#initialize(config = {}) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(config = {}) ⇒ Client
Returns a new instance of Client.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/khl/http/client.rb', line 52 def initialize(config = {}) raise ArgumentError, "missing token" unless config[:token] config[:token_type] ||= "Bot" config[:language] ||= "zh-cn" @asset = Asset.new(config) @badge = Badge.new(config) @blacklist = Blacklist.new(config) @channel = Channel.new(config) @channel_role = ChannelRole.new(config) @channel_user = ChannelUser.new(config) @direct_message = DirectMessage.new(config) @game = Game.new(config) @gateway = Gateway.new(config) @guild = Guild.new(config) @guild_emoji = GuildEmoji.new(config) @guild_mute = GuildMute.new(config) @guild_role = GuildRole.new(config) @intimacy = Intimacy.new(config) @invite = Invite.new(config) @message = Message.new(config) @user = User.new(config) @user_chat = UserChat.new(config) end |
Instance Attribute Details
#asset ⇒ Object (readonly)
Returns the value of attribute asset.
29 30 31 |
# File 'lib/khl/http/client.rb', line 29 def asset @asset end |
#badge ⇒ Object (readonly)
Returns the value of attribute badge.
29 30 31 |
# File 'lib/khl/http/client.rb', line 29 def badge @badge end |
#blacklist ⇒ Object (readonly)
Returns the value of attribute blacklist.
29 30 31 |
# File 'lib/khl/http/client.rb', line 29 def blacklist @blacklist end |
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
29 30 31 |
# File 'lib/khl/http/client.rb', line 29 def channel @channel end |
#channel_role ⇒ Object (readonly)
Returns the value of attribute channel_role.
29 30 31 |
# File 'lib/khl/http/client.rb', line 29 def channel_role @channel_role end |
#channel_user ⇒ Object (readonly)
Returns the value of attribute channel_user.
29 30 31 |
# File 'lib/khl/http/client.rb', line 29 def channel_user @channel_user end |
#direct_message ⇒ Object (readonly)
Returns the value of attribute direct_message.
29 30 31 |
# File 'lib/khl/http/client.rb', line 29 def @direct_message end |
#game ⇒ Object (readonly)
Returns the value of attribute game.
29 30 31 |
# File 'lib/khl/http/client.rb', line 29 def game @game end |
#gateway ⇒ Object (readonly)
Returns the value of attribute gateway.
29 30 31 |
# File 'lib/khl/http/client.rb', line 29 def gateway @gateway end |
#guild ⇒ Object (readonly)
Returns the value of attribute guild.
29 30 31 |
# File 'lib/khl/http/client.rb', line 29 def guild @guild end |
#guild_emoji ⇒ Object (readonly)
Returns the value of attribute guild_emoji.
29 30 31 |
# File 'lib/khl/http/client.rb', line 29 def guild_emoji @guild_emoji end |
#guild_mute ⇒ Object (readonly)
Returns the value of attribute guild_mute.
29 30 31 |
# File 'lib/khl/http/client.rb', line 29 def guild_mute @guild_mute end |
#guild_role ⇒ Object (readonly)
Returns the value of attribute guild_role.
29 30 31 |
# File 'lib/khl/http/client.rb', line 29 def guild_role @guild_role end |
#intimacy ⇒ Object (readonly)
Returns the value of attribute intimacy.
29 30 31 |
# File 'lib/khl/http/client.rb', line 29 def intimacy @intimacy end |
#invite ⇒ Object (readonly)
Returns the value of attribute invite.
29 30 31 |
# File 'lib/khl/http/client.rb', line 29 def invite @invite end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
29 30 31 |
# File 'lib/khl/http/client.rb', line 29 def @message end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
29 30 31 |
# File 'lib/khl/http/client.rb', line 29 def user @user end |
#user_chat ⇒ Object (readonly)
Returns the value of attribute user_chat.
29 30 31 |
# File 'lib/khl/http/client.rb', line 29 def user_chat @user_chat end |