topgg 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/LICENSE +21 -0
- data/README.md +23 -11
- data/lib/lib.rb +37 -40
- data/lib/topgg/bot.rb +27 -24
- data/lib/topgg/botSearch.rb +7 -3
- data/lib/topgg/stats.rb +4 -1
- data/lib/topgg/user.rb +4 -1
- data/lib/topgg/votes.rb +4 -1
- data/topgg.gemspec +1 -1
- metadata +4 -6
- data/.bundle/config +0 -2
- data/CHANGELOG.md +0 -5
- data/pkg/topgg-1.0.1.gem +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: efdefad75123d5205da0ca899e47fe4f3c0c3a3269b7dfd7a68697f206bf36ec
|
|
4
|
+
data.tar.gz: 99703e90fe21baa924be88ea389ddf0bfb8a90e2580ef29138e350784feab723
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a31882f04bd664e714198254b4338fe5d8c68503fba6b0ae83f71d0e36dff130052c6f9c06dfd9eeef8c0abd384e750173f359a84746d73819d3083397cfad0b
|
|
7
|
+
data.tar.gz: 3f70900291e2d8fe4f7a574eda247281bb4f7e295286cea11f256f2648348e67c9d48aa7ba4966cef3ccefe6f8bd78c538840cdea4ceac49f509dd3c3ffcf323
|
data/Gemfile
CHANGED
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 rhydderchc
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
|
@@ -1,17 +1,27 @@
|
|
|
1
|
-
# Top.gg Ruby
|
|
1
|
+
# [Top.gg](https://top.gg) Ruby
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The Top.gg Ruby SDK is a lighweight package, that allows you
|
|
4
4
|
to fetch data from the top.gg api and post data such as statistics to the website.
|
|
5
5
|
|
|
6
|
+
It provides you with numerous methods to interact with the API.
|
|
6
7
|
## Dependencies
|
|
7
8
|
|
|
8
9
|
* Ruby
|
|
9
|
-
* Faraday (The client to automate requests)
|
|
10
10
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
13
|
+
``` bash
|
|
13
14
|
|
|
15
|
+
gem install topgg
|
|
14
16
|
|
|
17
|
+
```
|
|
18
|
+
## Note
|
|
19
|
+
|
|
20
|
+
You require a Token to interact with the Api.
|
|
21
|
+
The token can be found at `https://top.gg/bot/[YOUR_BOT_ID]/webhooks`
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+

|
|
15
25
|
## Example
|
|
16
26
|
|
|
17
27
|
Here's a straightforward example of how to request data with the wrapper.
|
|
@@ -21,27 +31,29 @@ require 'topgg'
|
|
|
21
31
|
|
|
22
32
|
client = Topgg.new("AUTH_TOKEN", "BOTID")
|
|
23
33
|
|
|
24
|
-
client.
|
|
34
|
+
client.get_bot("1234").defAvatar
|
|
25
35
|
# returns
|
|
26
36
|
# "6debd47ed13483642cf09e832ed0bc1b"
|
|
27
37
|
|
|
28
38
|
```
|
|
29
|
-
###
|
|
39
|
+
### Auto Posting
|
|
30
40
|
|
|
31
|
-
The
|
|
32
|
-
|
|
33
|
-
Here's how you can enable it
|
|
41
|
+
The library provides you with autoposting functionality, and autoposts at an interval of 30 minutes.
|
|
42
|
+
Here's how you can use it
|
|
34
43
|
|
|
35
44
|
```ruby
|
|
36
45
|
require 'topgg'
|
|
37
46
|
require 'discordrb'
|
|
38
47
|
|
|
39
48
|
bot = Discordrb::Bot.new token: "TOKEN"
|
|
40
|
-
client = Topgg.new("AUTH_TOKEN", "BOTID")
|
|
41
49
|
|
|
42
|
-
client.
|
|
50
|
+
client = Topgg.new("AUTH_TOKEN", "BOTID")
|
|
51
|
+
bot.ready do |event|
|
|
52
|
+
client.auto_post_stats(bot) # The discordrb bot client.
|
|
53
|
+
end
|
|
54
|
+
bot.run
|
|
43
55
|
```
|
|
44
56
|
|
|
45
57
|
# Documentation
|
|
46
58
|
|
|
47
|
-
Check out the
|
|
59
|
+
Check out the api reference [here](https://rubydoc.info/gems/topgg/)
|
data/lib/lib.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
require_relative 'topgg/utils/request'
|
|
3
4
|
require 'json'
|
|
4
5
|
require_relative 'topgg/bot'
|
|
5
6
|
require_relative 'topgg/botSearch'
|
|
@@ -15,90 +16,85 @@ class Topgg
|
|
|
15
16
|
def initialize(token, id)
|
|
16
17
|
@id = id
|
|
17
18
|
@token = token
|
|
18
|
-
@
|
|
19
|
-
url: 'https://top.gg/api',
|
|
20
|
-
headers: { 'authorization' => @token }
|
|
21
|
-
)
|
|
19
|
+
@request = Dbl::Utils::Request.new(token)
|
|
22
20
|
end
|
|
23
21
|
|
|
24
22
|
# The method fetches bot statistics from top.gg
|
|
25
23
|
# @param id [String] The id of the bot you want to fetch statistics from.
|
|
26
|
-
# @return [
|
|
27
|
-
def
|
|
28
|
-
resp = @
|
|
24
|
+
# @return [Dbl::Bot] The Bot Object
|
|
25
|
+
def get_bot(id)
|
|
26
|
+
resp = @request.get("bots/#{id}")
|
|
29
27
|
|
|
30
|
-
|
|
28
|
+
Dbl::Bot.new(resp)
|
|
31
29
|
end
|
|
32
30
|
|
|
33
31
|
# The method searches bots from top.gg using a keyword query.
|
|
34
|
-
# @param
|
|
35
|
-
#
|
|
36
|
-
# @
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
resp = @conn.get('bots', { search: query, limit: limit, offset: offset, sort: sort, fields: fields })
|
|
41
|
-
Spreader::BotSearch.new(JSON.parse(resp.body))
|
|
32
|
+
# @param [Object] params The parameters that can be used to query a search
|
|
33
|
+
# To know what the parameters are check it out here
|
|
34
|
+
# @return [Dbl::BotSearch] The BotSearch Object
|
|
35
|
+
def search_bot(params)
|
|
36
|
+
resp = @request.get('bots/search', params)
|
|
37
|
+
Dbl::BotSearch.new(resp)
|
|
42
38
|
end
|
|
43
39
|
|
|
44
40
|
# Search for a user on top.gg with id
|
|
45
41
|
# @param id [String] The id of the user to search for.
|
|
46
|
-
# @return [
|
|
42
|
+
# @return [Dbl::User]
|
|
47
43
|
def user(id)
|
|
48
|
-
resp = @
|
|
44
|
+
resp = @request.get("users/#{id}")
|
|
49
45
|
|
|
50
|
-
|
|
46
|
+
Dbl::User.new(resp)
|
|
51
47
|
end
|
|
52
48
|
|
|
53
49
|
# Get Bot statistics.
|
|
54
50
|
# @param id [String] Id of the bot you want to get statistics of
|
|
55
|
-
# @return [
|
|
56
|
-
def
|
|
57
|
-
resp = @
|
|
51
|
+
# @return [Dbl::Stats]
|
|
52
|
+
def get_stats(id)
|
|
53
|
+
resp = @request.get("bots/#{id}/stats")
|
|
58
54
|
|
|
59
|
-
|
|
55
|
+
Dbl::Stats.new(resp)
|
|
60
56
|
end
|
|
61
57
|
|
|
62
58
|
# Mini-method to query if the bot(self) was voted by the user.
|
|
63
59
|
# @param userid [String] The user id.
|
|
64
60
|
# @return [Boolean]
|
|
65
61
|
def voted?(userid)
|
|
66
|
-
resp = @
|
|
62
|
+
resp = @request.get("bots/#{@id}/check", { userId: userid })
|
|
67
63
|
|
|
68
|
-
ret =
|
|
64
|
+
ret = resp
|
|
69
65
|
ret['voted'] == 1
|
|
70
66
|
end
|
|
71
67
|
|
|
72
68
|
# Get the Last 1000 votes of the bot(self)
|
|
73
|
-
# @return [
|
|
69
|
+
# @return [Dbl::Votes]
|
|
74
70
|
def votes
|
|
75
|
-
resp = @
|
|
71
|
+
resp = @request.get("bots/#{@id}/votes")
|
|
76
72
|
|
|
77
|
-
|
|
73
|
+
Dbl::Votes.new(resp)
|
|
78
74
|
end
|
|
79
75
|
|
|
80
76
|
# Post Bot Statistics to the website
|
|
81
77
|
# @param server_count [Integer] The amount of servers the bot is in.
|
|
82
78
|
# @param shards [Integer] The amount of servers the bot is in per shard
|
|
83
79
|
# @param shard_count [Integer] The total number of shards.
|
|
84
|
-
def
|
|
85
|
-
|
|
80
|
+
def post_stats(server_count, shards: nil, shard_count: nil)
|
|
81
|
+
json_post = {
|
|
86
82
|
server_count: server_count,
|
|
87
83
|
shards: shards,
|
|
88
84
|
shard_count: shard_count
|
|
89
85
|
}.to_json
|
|
90
|
-
@
|
|
86
|
+
@request.post("bots/#{@id}/stats", json_post, { 'Content-Type' => 'application/json' })
|
|
91
87
|
end
|
|
92
88
|
|
|
93
|
-
#
|
|
89
|
+
# Auto-posts stats on to the top.gg website
|
|
94
90
|
# @param client [Discordrb::Bot] instanceof discordrb client.
|
|
95
|
-
def
|
|
91
|
+
def auto_post_stats(client)
|
|
96
92
|
semaphore = Mutex.new
|
|
97
93
|
Thread.new do
|
|
98
94
|
semaphore.synchronize do
|
|
99
95
|
interval 1800 do
|
|
100
|
-
|
|
101
|
-
|
|
96
|
+
server_len = client.servers.length
|
|
97
|
+
post_stats(server_len)
|
|
102
98
|
print("[TOPGG] : \033[31;1;4m Bot statistics has been successfully posted!\033[0m")
|
|
103
99
|
end
|
|
104
100
|
end
|
|
@@ -106,18 +102,19 @@ class Topgg
|
|
|
106
102
|
end
|
|
107
103
|
|
|
108
104
|
# Mini-method to get statistics on self
|
|
109
|
-
# @return [
|
|
105
|
+
# @return [get_bot]
|
|
110
106
|
def self
|
|
111
|
-
|
|
107
|
+
get_bot(@id)
|
|
112
108
|
end
|
|
113
109
|
|
|
114
110
|
def interval(seconds)
|
|
115
111
|
loop do
|
|
116
112
|
yield
|
|
117
|
-
|
|
118
|
-
|
|
113
|
+
sleep seconds
|
|
119
114
|
end
|
|
120
115
|
end
|
|
121
116
|
end
|
|
122
117
|
|
|
123
118
|
|
|
119
|
+
|
|
120
|
+
|
data/lib/topgg/bot.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module
|
|
1
|
+
module Dbl
|
|
2
2
|
# The Bot class spreads the json parsed hash into different methods
|
|
3
3
|
class Bot
|
|
4
4
|
# Initializes the Bot class
|
|
@@ -10,28 +10,31 @@ module Spreader
|
|
|
10
10
|
# @return [Hash]
|
|
11
11
|
attr_reader :obj
|
|
12
12
|
|
|
13
|
+
alias :raw :obj
|
|
14
|
+
|
|
15
|
+
alias data obj
|
|
13
16
|
# Returns error message, if there's an error
|
|
14
17
|
# @return [String]
|
|
15
18
|
def error
|
|
16
|
-
@obj['error']
|
|
19
|
+
@obj['error'].to_str
|
|
17
20
|
end
|
|
18
21
|
|
|
19
22
|
# Returns the default Avatar of the client
|
|
20
23
|
# @return [String]
|
|
21
24
|
def defAvatar
|
|
22
|
-
@obj['defAvatar']
|
|
25
|
+
@obj['defAvatar'].to_str
|
|
23
26
|
end
|
|
24
27
|
|
|
25
28
|
# Returns the invite link of the bot
|
|
26
29
|
# @return [String]
|
|
27
30
|
def invite
|
|
28
|
-
@obj['invite']
|
|
31
|
+
@obj['invite'].to_str
|
|
29
32
|
end
|
|
30
33
|
|
|
31
34
|
# Returns the bot website, if configured
|
|
32
35
|
# @return [String]
|
|
33
36
|
def website
|
|
34
|
-
@obj['website']
|
|
37
|
+
@obj['website'].to_str
|
|
35
38
|
end
|
|
36
39
|
|
|
37
40
|
# Returns support server link
|
|
@@ -43,37 +46,37 @@ module Spreader
|
|
|
43
46
|
# Returns github repository link, if any
|
|
44
47
|
# @return [String]
|
|
45
48
|
def github
|
|
46
|
-
@obj['github']
|
|
49
|
+
@obj['github'].to_str
|
|
47
50
|
end
|
|
48
51
|
|
|
49
52
|
# Returns the long Description of the bot
|
|
50
53
|
# @return [String]
|
|
51
54
|
def longdesc
|
|
52
|
-
@obj['longdesc']
|
|
55
|
+
@obj['longdesc'].to_str
|
|
53
56
|
end
|
|
54
57
|
|
|
55
58
|
# Returns the short description of the bot
|
|
56
59
|
# @return [String]
|
|
57
60
|
def shortdesc
|
|
58
|
-
@obj['shortdesc']
|
|
61
|
+
@obj['shortdesc'].to_str
|
|
59
62
|
end
|
|
60
63
|
|
|
61
64
|
# Returns the default prefix of the bot
|
|
62
65
|
# @return [String]
|
|
63
66
|
def prefix
|
|
64
|
-
@obj['prefix']
|
|
67
|
+
@obj['prefix'].to_str
|
|
65
68
|
end
|
|
66
69
|
|
|
67
70
|
# Returns the bot library
|
|
68
71
|
# @return [String]
|
|
69
72
|
def lib
|
|
70
|
-
@obj['lib']
|
|
73
|
+
@obj['lib'].to_str
|
|
71
74
|
end
|
|
72
75
|
|
|
73
76
|
# Returns the bot client id
|
|
74
77
|
# @return [String]
|
|
75
78
|
def clientid
|
|
76
|
-
@obj['clientid']
|
|
79
|
+
@obj['clientid'].to_str
|
|
77
80
|
end
|
|
78
81
|
|
|
79
82
|
# Returns the avatar link of the bot
|
|
@@ -85,19 +88,19 @@ module Spreader
|
|
|
85
88
|
# Returns the bot id
|
|
86
89
|
# @return [String]
|
|
87
90
|
def id
|
|
88
|
-
@obj['id']
|
|
91
|
+
@obj['id'].to_str
|
|
89
92
|
end
|
|
90
93
|
|
|
91
94
|
# Returns the bot descriminator
|
|
92
95
|
# @return [String]
|
|
93
96
|
def descriminator
|
|
94
|
-
@obj['descriminator']
|
|
97
|
+
@obj['descriminator'].to_str
|
|
95
98
|
end
|
|
96
99
|
|
|
97
100
|
# Returns the bot username
|
|
98
101
|
# @return [String]
|
|
99
102
|
def username
|
|
100
|
-
@obj['username']
|
|
103
|
+
@obj['username'].to_str
|
|
101
104
|
end
|
|
102
105
|
|
|
103
106
|
# Returns the date on which the bot was submitted
|
|
@@ -115,61 +118,61 @@ module Spreader
|
|
|
115
118
|
# Returns the amount of shards
|
|
116
119
|
# @return [String]
|
|
117
120
|
def shard_count
|
|
118
|
-
@obj['shard_count']
|
|
121
|
+
@obj['shard_count'].to_str
|
|
119
122
|
end
|
|
120
123
|
|
|
121
124
|
# Returns configured guilds in which the bot is in
|
|
122
125
|
# @return [String]
|
|
123
126
|
def guilds
|
|
124
|
-
@obj['guilds']
|
|
127
|
+
@obj['guilds'].to_str
|
|
125
128
|
end
|
|
126
129
|
|
|
127
130
|
# Returns the amount of guilds per shard of the bot
|
|
128
131
|
# @return [String]
|
|
129
132
|
def shards
|
|
130
|
-
@obj['shards']
|
|
133
|
+
@obj['shards'].to_str
|
|
131
134
|
end
|
|
132
135
|
|
|
133
136
|
# Returns the monthyPoints of the bot
|
|
134
137
|
# @return [String]
|
|
135
138
|
def monthlyPoints
|
|
136
|
-
@obj['monthlyPoints']
|
|
139
|
+
@obj['monthlyPoints'].to_str
|
|
137
140
|
end
|
|
138
141
|
|
|
139
142
|
# Returns the total points of the bot
|
|
140
143
|
# @return [String]
|
|
141
144
|
def points
|
|
142
|
-
@obj['points']
|
|
145
|
+
@obj['points'].to_str
|
|
143
146
|
end
|
|
144
147
|
|
|
145
148
|
# Returns true/false depending on if the bot is certified or not
|
|
146
149
|
# @return [Boolean]
|
|
147
150
|
def certifiedBot
|
|
148
|
-
@obj['certifiedBot']
|
|
151
|
+
@obj['certifiedBot'].to_str
|
|
149
152
|
end
|
|
150
153
|
|
|
151
154
|
# Returns the owner ids
|
|
152
155
|
# @return [Array<String>]
|
|
153
156
|
def owners
|
|
154
|
-
@obj['owners']
|
|
157
|
+
@obj['owners'].to_str
|
|
155
158
|
end
|
|
156
159
|
|
|
157
160
|
# Return the bot tags
|
|
158
161
|
# @return [Array<String>]
|
|
159
162
|
def tags
|
|
160
|
-
@obj['tags']
|
|
163
|
+
@obj['tags'].to_str
|
|
161
164
|
end
|
|
162
165
|
|
|
163
166
|
# Returns the bot banner url
|
|
164
167
|
# @return [String]
|
|
165
168
|
def bannerUrl
|
|
166
|
-
@obj['bannerUrl']
|
|
169
|
+
@obj['bannerUrl'].to_str
|
|
167
170
|
end
|
|
168
171
|
|
|
169
172
|
# Returns the donate bot guild ID
|
|
170
173
|
# @return [String]
|
|
171
174
|
def donatebotguildid
|
|
172
|
-
@obj['donatebotguildid']
|
|
175
|
+
@obj['donatebotguildid'].to_str
|
|
173
176
|
end
|
|
174
177
|
end
|
|
175
178
|
end
|
data/lib/topgg/botSearch.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
module
|
|
2
|
+
module Dbl
|
|
3
3
|
# This class spreads the BotSearch Response body into different methods
|
|
4
4
|
class BotSearch
|
|
5
5
|
# Initalizes the BotSearch class
|
|
@@ -10,11 +10,15 @@ module Spreader
|
|
|
10
10
|
# Get raw hash response
|
|
11
11
|
# @return [Hash]
|
|
12
12
|
attr_reader :obj
|
|
13
|
+
|
|
14
|
+
alias raw obj
|
|
15
|
+
|
|
16
|
+
alias data obj
|
|
13
17
|
|
|
14
18
|
# The Total number of results
|
|
15
19
|
# @return [Integer]
|
|
16
20
|
def total
|
|
17
|
-
@obj['total']
|
|
21
|
+
@obj['total'].to_i
|
|
18
22
|
end
|
|
19
23
|
|
|
20
24
|
# The first result
|
|
@@ -26,7 +30,7 @@ module Spreader
|
|
|
26
30
|
# The number of bots shown in the first page
|
|
27
31
|
# @return [Integer]
|
|
28
32
|
def count
|
|
29
|
-
@obj['count']
|
|
33
|
+
@obj['count'].to_i
|
|
30
34
|
end
|
|
31
35
|
|
|
32
36
|
# Iterates through the results
|
data/lib/topgg/stats.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module
|
|
1
|
+
module Dbl
|
|
2
2
|
# The Stats class spreads the json response into different methods
|
|
3
3
|
class Stats
|
|
4
4
|
# Initializes the Stats class
|
|
@@ -9,7 +9,10 @@ module Spreader
|
|
|
9
9
|
|
|
10
10
|
# Returns raw Hash of the response
|
|
11
11
|
attr_reader :obj
|
|
12
|
+
|
|
13
|
+
alias raw obj
|
|
12
14
|
|
|
15
|
+
alias data obj
|
|
13
16
|
# Returns the server Count of the bot
|
|
14
17
|
# @return [Integer]
|
|
15
18
|
def server_count
|
data/lib/topgg/user.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
module
|
|
2
|
+
module Dbl
|
|
3
3
|
# The User class, used for Spreading the response body into different methods
|
|
4
4
|
class User
|
|
5
5
|
# Instantiates the class variables
|
|
@@ -10,6 +10,9 @@ module Spreader
|
|
|
10
10
|
|
|
11
11
|
attr_reader :obj
|
|
12
12
|
|
|
13
|
+
alias raw obj
|
|
14
|
+
|
|
15
|
+
alias data obj
|
|
13
16
|
# Check for errors, if any
|
|
14
17
|
def error
|
|
15
18
|
@obj['error']
|
data/lib/topgg/votes.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module
|
|
1
|
+
module Dbl
|
|
2
2
|
# This class Spreads the Vote response body into different methods.
|
|
3
3
|
class Votes
|
|
4
4
|
# Initializes the votes class
|
|
@@ -10,7 +10,10 @@ module Spreader
|
|
|
10
10
|
# Get raw hash return of the object
|
|
11
11
|
# @return [Hash]
|
|
12
12
|
attr_reader :obj
|
|
13
|
+
|
|
14
|
+
alias raw obj
|
|
13
15
|
|
|
16
|
+
alias data obj
|
|
14
17
|
# Get the first vote amongst all the other votes.
|
|
15
18
|
# @return [Spreader::User]
|
|
16
19
|
def first
|
data/topgg.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: topgg
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Adonis Tremblay
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-10-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: This is a ruby library of the top.gg API.
|
|
14
14
|
email:
|
|
@@ -17,9 +17,8 @@ executables: []
|
|
|
17
17
|
extensions: []
|
|
18
18
|
extra_rdoc_files: []
|
|
19
19
|
files:
|
|
20
|
-
- ".bundle/config"
|
|
21
|
-
- CHANGELOG.md
|
|
22
20
|
- Gemfile
|
|
21
|
+
- LICENSE
|
|
23
22
|
- LICENSE.txt
|
|
24
23
|
- README.md
|
|
25
24
|
- Rakefile
|
|
@@ -29,7 +28,6 @@ files:
|
|
|
29
28
|
- lib/topgg/stats.rb
|
|
30
29
|
- lib/topgg/user.rb
|
|
31
30
|
- lib/topgg/votes.rb
|
|
32
|
-
- pkg/topgg-1.0.1.gem
|
|
33
31
|
- topgg.gemspec
|
|
34
32
|
homepage: https://github.com/rhydderchc/topgg-ruby
|
|
35
33
|
licenses:
|
|
@@ -54,7 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
54
52
|
- !ruby/object:Gem::Version
|
|
55
53
|
version: '0'
|
|
56
54
|
requirements: []
|
|
57
|
-
rubygems_version: 3.
|
|
55
|
+
rubygems_version: 3.2.22
|
|
58
56
|
signing_key:
|
|
59
57
|
specification_version: 4
|
|
60
58
|
summary: A top.gg api wrapper for ruby.
|
data/.bundle/config
DELETED
data/CHANGELOG.md
DELETED
data/pkg/topgg-1.0.1.gem
DELETED
|
Binary file
|