starcall 0.4.0 → 0.5.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/CHANGELOG.md +15 -0
- data/Gemfile.lock +2 -2
- data/README.md +90 -0
- data/lib/starcall/endpoints/clash_v1.rb +61 -0
- data/lib/starcall/endpoints/endpoints.rb +3 -0
- data/lib/starcall/endpoints/summoner_v4.rb +53 -0
- data/lib/starcall/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e6005cf053fb73f0bd6dc29b8f0f9384ac3df2494428a1adb2ef891c968591d
|
4
|
+
data.tar.gz: f87360fdb12ee7f030b1d87fb4572d7d081d0d82564a18488b8fd187eda3568c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed33c6040ec1ffa32af6b2f5779066193eaffed0678dcb37ac5e58a1748615faf09d3140042ebc509d3532d59e08978269142e0e87ef3fe26b816aae0d62628a
|
7
|
+
data.tar.gz: cb5f5a86413892a3d5f117b8880883e2414b9111da40588da013c2133c03c75621a44b5a28f860d5bbdf325c652778c5e8fe6b2141af034b0c4f6622e68bdfd7
|
data/CHANGELOG.md
CHANGED
@@ -13,6 +13,21 @@ None
|
|
13
13
|
|
14
14
|
---
|
15
15
|
|
16
|
+
## v0.5.0 - Anivia
|
17
|
+

|
18
|
+
|
19
|
+
### New features
|
20
|
+
- Add Clash V1 endpoint.
|
21
|
+
- Add the summoner endpoint.
|
22
|
+
|
23
|
+
### Changes
|
24
|
+
None
|
25
|
+
|
26
|
+
### Bug fixes
|
27
|
+
- Add Champion V3 to the endpoints file, making it accessible.
|
28
|
+
|
29
|
+
---
|
30
|
+
|
16
31
|
## v0.4.0 - Amumu
|
17
32
|

|
18
33
|
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -122,6 +122,47 @@ Details about profile icons and where they can be found on the sprite sheets.
|
|
122
122
|
## Endpoints
|
123
123
|
The below commands require a Riot API key.
|
124
124
|
It needs to be saved as an ENV var and called `RIOT_API_KEY`
|
125
|
+
### SummonerV4
|
126
|
+
#### `by_account_id`
|
127
|
+
[Riot API Documentation](https://developer.riotgames.com/apis#summoner-v4/GET_getByAccountId)
|
128
|
+
|
129
|
+
Required fields:
|
130
|
+
- `encrypted_summoner_id` (The encrypted summoner ID for the summoner you want to know about.)
|
131
|
+
- `region` (The region that the summoner is in.)
|
132
|
+
|
133
|
+
Optional fields:
|
134
|
+
None
|
135
|
+
|
136
|
+
#### `by_summoner_name`
|
137
|
+
[Riot API Documentation](https://developer.riotgames.com/apis#summoner-v4/GET_getBySummonerName)
|
138
|
+
|
139
|
+
Required fields:
|
140
|
+
- `summoner_name` (The summoner name for the summoner you want to know about.)
|
141
|
+
- `region` (The region that the summoner is in.)
|
142
|
+
|
143
|
+
Optional fields:
|
144
|
+
None
|
145
|
+
|
146
|
+
#### `by_puuid`
|
147
|
+
[Riot API Documentation](https://developer.riotgames.com/apis#summoner-v4/GET_getByPUUID)
|
148
|
+
|
149
|
+
Required fields:
|
150
|
+
- `puuid` (The puuid for the summoner you want to know about.)
|
151
|
+
- `region` (The region that the summoner is in.)
|
152
|
+
|
153
|
+
Optional fields:
|
154
|
+
None
|
155
|
+
|
156
|
+
#### `by_summoner_id`
|
157
|
+
[Riot API Documentation](https://developer.riotgames.com/apis#summoner-v4/GET_getBySummonerId)
|
158
|
+
|
159
|
+
Required fields:
|
160
|
+
- `summoner_id` (The summoner id for the summoner you want to know about.)
|
161
|
+
- `region` (The region that the summoner is in.)
|
162
|
+
|
163
|
+
Optional fields:
|
164
|
+
None
|
165
|
+
|
125
166
|
### Champion Mastery V4
|
126
167
|
|
127
168
|
#### `summoner`
|
@@ -156,6 +197,55 @@ Required fields:
|
|
156
197
|
Optional fields:
|
157
198
|
- `region` (By default it will assume `euw`, if you want to know for a specific region, you can pass that in.)
|
158
199
|
|
200
|
+
### Clash V3
|
201
|
+
#### `clash_by_summoner_id`
|
202
|
+
[Riot API Documentation](https://developer.riotgames.com/apis#clash-v1/GET_getPlayersBySummoner)
|
203
|
+
|
204
|
+
Required fields:
|
205
|
+
- `encrypted_summoner_id` (the encrypted summoner ID for the summoner you want to know about.)
|
206
|
+
- `region` (The region that the summoner is in.)
|
207
|
+
|
208
|
+
Optional fields:
|
209
|
+
- None
|
210
|
+
|
211
|
+
#### `clash_by_team_id`
|
212
|
+
[Riot API Documentation](https://developer.riotgames.com/apis#clash-v1/GET_getTeamById)
|
213
|
+
|
214
|
+
Required fields:
|
215
|
+
- `team_id` (the team ID for the team you want to know about.)
|
216
|
+
- `region` (The region that the team is in.)
|
217
|
+
|
218
|
+
Optional fields:
|
219
|
+
- None
|
220
|
+
|
221
|
+
#### `clash_tournaments`
|
222
|
+
[Riot API Documentation](https://developer.riotgames.com/apis#clash-v1/GET_getTournaments)
|
223
|
+
|
224
|
+
Required fields:
|
225
|
+
- `region` (The region that you want to know about.)
|
226
|
+
|
227
|
+
Optional fields:
|
228
|
+
- None
|
229
|
+
|
230
|
+
#### `clash_tournaments_by_team_id`
|
231
|
+
[Riot API Documentation](https://developer.riotgames.com/apis#clash-v1/GET_getTournaments)
|
232
|
+
|
233
|
+
Required fields:
|
234
|
+
- `team_id` (the team ID for the team you want to know about.)
|
235
|
+
- `region` (The region that the team is in.)
|
236
|
+
|
237
|
+
Optional fields:
|
238
|
+
- None
|
239
|
+
|
240
|
+
#### `clash_tournaments_by_tournament_id`
|
241
|
+
[Riot API Documentation](https://developer.riotgames.com/apis#clash-v1/GET_getTournaments)
|
242
|
+
|
243
|
+
Required fields:
|
244
|
+
- `tournament_id` (the tournament ID for the tournament you want to know about.)
|
245
|
+
- `region` (The region that the tournament is in.)
|
246
|
+
|
247
|
+
Optional fields:
|
248
|
+
- None
|
159
249
|
|
160
250
|
## Development
|
161
251
|
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'starcall/helpers/region_parser'
|
4
|
+
require 'starcall/api_requests'
|
5
|
+
|
6
|
+
module Starcall
|
7
|
+
module Endpoints
|
8
|
+
# Methods used to get information about clash
|
9
|
+
class ClashV1
|
10
|
+
# Get players by summoner ID.
|
11
|
+
def self.clash_by_summoner_id(encrypted_summoner_id:, region:)
|
12
|
+
Starcall::Regions.valid?(region: region)
|
13
|
+
Starcall::ApiRequests.make_request(
|
14
|
+
url: "https://#{parse_region(region: region)}.api.riotgames.com"\
|
15
|
+
"/lol/clash/v1/players/by-summoner/#{encrypted_summoner_id}"
|
16
|
+
)
|
17
|
+
end
|
18
|
+
|
19
|
+
# Get team by ID.
|
20
|
+
def self.clash_by_team_id(team_id:, region:)
|
21
|
+
Starcall::Regions.valid?(region: region)
|
22
|
+
Starcall::ApiRequests.make_request(
|
23
|
+
url: "https://#{parse_region(region: region)}.api.riotgames.com"\
|
24
|
+
"/lol/clash/v1/teams/#{team_id}"
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Get all active or upcoming tournaments.
|
29
|
+
def self.clash_tournaments(region:)
|
30
|
+
Starcall::Regions.valid?(region: region)
|
31
|
+
Starcall::ApiRequests.make_request(
|
32
|
+
url: "https://#{parse_region(region: region)}.api.riotgames.com/lol/clash/v1/tournaments"
|
33
|
+
)
|
34
|
+
end
|
35
|
+
|
36
|
+
# Get tournament by team ID.
|
37
|
+
def self.clash_tournaments_by_team_id(team_id:, region:)
|
38
|
+
Starcall::Regions.valid?(region: region)
|
39
|
+
Starcall::ApiRequests.make_request(
|
40
|
+
url: "https://#{parse_region(region: region)}.api.riotgames.com"\
|
41
|
+
"/lol/clash/v1/tournaments/by-team/#{team_id}"
|
42
|
+
)
|
43
|
+
end
|
44
|
+
|
45
|
+
# Get tournament by ID
|
46
|
+
def self.clash_tournaments_by_tournament_id(tournament_id:, region:)
|
47
|
+
Starcall::Regions.valid?(region: region)
|
48
|
+
Starcall::ApiRequests.make_request(
|
49
|
+
url: "https://#{parse_region(region: region)}.api.riotgames.com"\
|
50
|
+
"/lol/clash/v1/tournaments/#{tournament_id}"
|
51
|
+
)
|
52
|
+
end
|
53
|
+
|
54
|
+
def self.parse_region(region:)
|
55
|
+
Starcall::Helpers::RegionParser.parse(region: region)
|
56
|
+
end
|
57
|
+
|
58
|
+
private_class_method :parse_region
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'starcall/helpers/region_parser'
|
4
|
+
require 'starcall/api_requests'
|
5
|
+
|
6
|
+
module Starcall
|
7
|
+
module Endpoints
|
8
|
+
# Methods used to get information about summoners.
|
9
|
+
class SummonerV4
|
10
|
+
# Get a summoner by account ID.
|
11
|
+
def self.by_account_id(encrypted_account_id:, region:)
|
12
|
+
Starcall::Regions.valid?(region: region)
|
13
|
+
Starcall::ApiRequests.make_request(
|
14
|
+
url: "https://#{parse_region(region: region)}.api.riotgames.com"\
|
15
|
+
"/lol/summoner/v4/summoners/by-account/#{encrypted_account_id}"
|
16
|
+
)
|
17
|
+
end
|
18
|
+
|
19
|
+
# Get a summoner by summoner name.
|
20
|
+
def self.by_summoner_name(summoner_name:, region:)
|
21
|
+
Starcall::Regions.valid?(region: region)
|
22
|
+
Starcall::ApiRequests.make_request(
|
23
|
+
url: "https://#{parse_region(region: region)}.api.riotgames.com"\
|
24
|
+
"/lol/summoner/v4/summoners/by-name/#{summoner_name}"
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Get a summoner by PUUID.
|
29
|
+
def self.by_puuid(puuid:, region:)
|
30
|
+
Starcall::Regions.valid?(region: region)
|
31
|
+
Starcall::ApiRequests.make_request(
|
32
|
+
url: "https://#{parse_region(region: region)}.api.riotgames.com"\
|
33
|
+
"/lol/summoner/v4/summoners/by-puuid/#{puuid}"
|
34
|
+
)
|
35
|
+
end
|
36
|
+
|
37
|
+
# Get a summoner by summoner ID.
|
38
|
+
def self.by_summoner_id(summoner_id:, region:)
|
39
|
+
Starcall::Regions.valid?(region: region)
|
40
|
+
Starcall::ApiRequests.make_request(
|
41
|
+
url: "https://#{parse_region(region: region)}.api.riotgames.com"\
|
42
|
+
"/lol/summoner/v4/summoners/#{summoner_id}"
|
43
|
+
)
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.parse_region(region:)
|
47
|
+
Starcall::Helpers::RegionParser.parse(region: region)
|
48
|
+
end
|
49
|
+
|
50
|
+
private_class_method :parse_region
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
data/lib/starcall/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: starcall
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kelvin Samuel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -130,7 +130,9 @@ files:
|
|
130
130
|
- lib/starcall/api_requests.rb
|
131
131
|
- lib/starcall/endpoints/champion_mastery_v4.rb
|
132
132
|
- lib/starcall/endpoints/champion_v3.rb
|
133
|
+
- lib/starcall/endpoints/clash_v1.rb
|
133
134
|
- lib/starcall/endpoints/endpoints.rb
|
135
|
+
- lib/starcall/endpoints/summoner_v4.rb
|
134
136
|
- lib/starcall/errors/errors.rb
|
135
137
|
- lib/starcall/errors/invalid_language.rb
|
136
138
|
- lib/starcall/errors/invalid_region.rb
|
@@ -163,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
165
|
- !ruby/object:Gem::Version
|
164
166
|
version: '0'
|
165
167
|
requirements: []
|
166
|
-
rubygems_version: 3.0.
|
168
|
+
rubygems_version: 3.0.1
|
167
169
|
signing_key:
|
168
170
|
specification_version: 4
|
169
171
|
summary: A Helper Gem for calling Riots API
|