outrageous 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +20 -0
- data/README.md +175 -0
- data/lib/outrageous.rb +8 -0
- data/lib/outrageous/base.rb +38 -0
- data/lib/outrageous/champion.rb +9 -0
- data/lib/outrageous/game.rb +9 -0
- data/lib/outrageous/league.rb +38 -0
- data/lib/outrageous/static_data/base.rb +54 -0
- data/lib/outrageous/static_data/champion.rb +8 -0
- data/lib/outrageous/static_data/item.rb +8 -0
- data/lib/outrageous/static_data/mastery.rb +8 -0
- data/lib/outrageous/static_data/realm.rb +8 -0
- data/lib/outrageous/static_data/rune.rb +8 -0
- data/lib/outrageous/static_data/summoner_spell.rb +8 -0
- data/lib/outrageous/stats.rb +14 -0
- data/lib/outrageous/summoner.rb +30 -0
- data/lib/outrageous/team.rb +17 -0
- metadata +147 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c34f7aabd31ac9c5fb8db8ca83b94e6b52104c08
|
4
|
+
data.tar.gz: 164f347f491b2fd13a9d4dbf3021a2112adc07ec
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bc71ffcae681ce9c379823bf3fb1521d6fc183298cf81ebfc72bf20b0db0538b01e587406003bb99930c8a31ffd20b2f061b7cd66af1552affbc35e3fd7da254
|
7
|
+
data.tar.gz: d8340dba22a6d69f642e6b86fcc46ddc1c70ec4cca014043993802543ffcb3a39193308f52b16f4bd7c5dc0a5f7cd562a3e2c7b0bac00bc8f791f40af5a6fd2b
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2014 xxswingxx
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,175 @@
|
|
1
|
+
# Outrageous
|
2
|
+
|
3
|
+
Outrageous is a ruby wrapper in the form of a outrageous gem for the official [League of Legends API](https://developer.riotgames.com/).
|
4
|
+
|
5
|
+
![Gems are truly, truly, truly outrageous...](http://x1.fjcdn.com/comments/4256386+_35ff0c0c528c84aacf20464730f61b4f.jpg "Gems are truly, truly, truly outrageous...")
|
6
|
+
|
7
|
+
This library doesn't actually know anything about the League of Legends API. Instead it relies on users to read the League of Legends API Documentation and builds Ruby data structures (i.e. nested Hash and Array combos). The transformation is quite simple; once you understand how the mapping works any League of Legends API request can easily be written as a Ruby data structure.
|
8
|
+
|
9
|
+
## Installation and usage
|
10
|
+
|
11
|
+
As usual, you know, don't you? Just type in your console
|
12
|
+
|
13
|
+
```bash
|
14
|
+
gem install outrageous
|
15
|
+
```
|
16
|
+
or place it in your Gemfile
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
gem 'outrageous'
|
20
|
+
```
|
21
|
+
Grab yout API key from [here](https://developer.riotgames.com/) and now you are ready to use your Ruby for vigor. Example usage:
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
# region is optional, by default it uses 'euw'
|
25
|
+
client = Outrageous::Champion.new(api_key: 'your-truly-truly-truly-outrageously-api-key', region: 'euw')
|
26
|
+
client.all(freeToPlay: true)
|
27
|
+
client.response # => Hash
|
28
|
+
client.status # => 200, 401, 404 ...
|
29
|
+
```
|
30
|
+
|
31
|
+
## API calls
|
32
|
+
|
33
|
+
### champion-v1.1 [BR, EUNE, EUW, LAN, LAS, NA, OCE]
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
# GET /api/lol/{region}/v1.1/champion
|
37
|
+
Outrageous::Champion.new(api_key: 'your-truly-truly-truly-outrageously-api-key').all(champData: 'all', locale: 'es_ES')
|
38
|
+
```
|
39
|
+
|
40
|
+
### game-v1.3 [BR, EUNE, EUW, LAN, LAS, NA, OCE]
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
# GET /api/lol/{region}/v1.3/game/by-summoner/{summonerId}/recent
|
44
|
+
Outrageous::Game.new(api_key: 'your-truly-truly-truly-outrageously-api-key').find(summoner_id)
|
45
|
+
```
|
46
|
+
|
47
|
+
## league-v2.3 [BR, EUNE, EUW, LAN, LAS, NA, OCE, RU, TR] Show/Hide List OperationsExpand Operations
|
48
|
+
|
49
|
+
```ruby
|
50
|
+
# GET /api/lol/{region}/v2.3/league/by-summoner/{summonerId} Retrieves leagues data for summoner, including summoner's teams. (REST)
|
51
|
+
Outrageous::League.new(api_key: 'your-truly-truly-truly-outrageously-api-key').get_leagues_with_team_by_summoner_id(summoner_id)
|
52
|
+
|
53
|
+
# GET /api/lol/{region}/v2.3/league/by-summoner/{summonerId}/entry Retrieves leagues entry data for summoner, including summoner's teams. (REST)
|
54
|
+
Outrageous::League.new(api_key: 'your-truly-truly-truly-outrageously-api-key').get_leagues_by_summoner_id(summoner_id)
|
55
|
+
|
56
|
+
# GET /api/lol/{region}/v2.3/league/by-team/{teamId} Retrieves leagues data for team. (REST)
|
57
|
+
Outrageous::League.new(api_key: 'your-truly-truly-truly-outrageously-api-key').get_leagues_by_team_id(team_id)
|
58
|
+
|
59
|
+
# GET /api/lol/{region}/v2.3/league/by-team/{teamId}/entry Retrieves leagues entry data for team. (REST)
|
60
|
+
Outrageous::League.new(api_key: 'your-truly-truly-truly-outrageously-api-key').get_leagues_entry_by_team_id(team_id)
|
61
|
+
|
62
|
+
# GET /api/lol/{region}/v2.3/league/challenger Retrieves challenger tier leagues. (REST)
|
63
|
+
Outrageous::League.new(api_key: 'your-truly-truly-truly-outrageously-api-key').get_challenger_info(type)d
|
64
|
+
|
65
|
+
```
|
66
|
+
|
67
|
+
### lol-static-data-v1 [BR, EUNE, EUW, KR, LAN, LAS, NA, OCE, RU, TR] Show/Hide List OperationsExpand Operations
|
68
|
+
|
69
|
+
Usually the methods are ```all(options = {})``` or ```find(id, options = {})```. Options hash is fully optional (REAAAAAALLYYY???).
|
70
|
+
|
71
|
+
```ruby
|
72
|
+
# GET /api/lol/static-data/{region}/v1/champion Retrieves champion list. (REST)
|
73
|
+
Outrageous::StaticData::Champion.new(api_key: 'your-truly-truly-truly-outrageously-api-key').all(champData: 'all', locale: 'es_ES')
|
74
|
+
|
75
|
+
# GET /api/lol/static-data/{region}/v1/champion/{id} Retrieves a champion by its id. (REST)
|
76
|
+
Outrageous::StaticData::Champion.new(api_key: 'your-truly-truly-truly-outrageously-api-key').find(champion_id, champData: 'all', locale: 'es_ES')
|
77
|
+
|
78
|
+
# GET /api/lol/static-data/{region}/v1/item Retrieves item list. (REST)
|
79
|
+
Outrageous::StaticData::Item.new(api_key: 'your-truly-truly-truly-outrageously-api-key').all(itemData: 'all', locale: 'es_ES')
|
80
|
+
|
81
|
+
# GET /api/lol/static-data/{region}/v1/item/{id} Retrieves item by its unique id. (REST)
|
82
|
+
Outrageous::StaticData::Item.new(api_key: 'your-truly-truly-truly-outrageously-api-key').find(item_id, itemData: 'all', locale: 'es_ES')
|
83
|
+
|
84
|
+
# GET /api/lol/static-data/{region}/v1/mastery Retrieves mastery list. (REST)
|
85
|
+
Outrageous::StaticData::Mastery.new(api_key: 'your-truly-truly-truly-outrageously-api-key').all(masteryListData: 'all', locale: 'es_ES')
|
86
|
+
|
87
|
+
# GET /api/lol/static-data/{region}/v1/mastery/{id} Retrieves mastery item by its unique id. (REST)
|
88
|
+
Outrageous::StaticData::Mastery.new(api_key: 'your-truly-truly-truly-outrageously-api-key').find(summoner_id, masteryListData: 'all', locale: 'es_ES')
|
89
|
+
|
90
|
+
# GET /api/lol/static-data/{region}/v1/realm Retrieve realm data. (REST)
|
91
|
+
Outrageous::StaticData::Realm.new(api_key: 'your-truly-truly-truly-outrageously-api-key').all
|
92
|
+
|
93
|
+
# GET /api/lol/static-data/{region}/v1/rune Retrieves rune list. (REST)
|
94
|
+
Outrageous::StaticData::Rune.new(api_key: 'your-truly-truly-truly-outrageously-api-key').all(runeListData: 'all', locale: 'es_ES')
|
95
|
+
|
96
|
+
# GET /api/lol/static-data/{region}/v1/rune/{id} Retrieves rune by its unique id. (REST)
|
97
|
+
Outrageous::StaticData::Rune.new(api_key: 'your-truly-truly-truly-outrageously-api-key').find(rune_id, runeListData: 'all', locale: 'es_ES')
|
98
|
+
|
99
|
+
# GET /api/lol/static-data/{region}/v1/summoner-spell Retrieves summoner spell list. (REST)
|
100
|
+
Outrageous::StaticData::SummonerSpell.new(api_key: 'your-truly-truly-truly-outrageously-api-key').all(spellData: 'all', locale: 'es_ES')
|
101
|
+
|
102
|
+
# GET /api/lol/static-data/{region}/v1/summoner-spell/{id} Retrieves summoner spell by its unique id. (REST)
|
103
|
+
Outrageous::StaticData::SummonerSpell.new(api_key: 'your-truly-truly-truly-outrageously-api-key').find(summoner_spell_id, spellData: 'all', locale: 'es_ES')
|
104
|
+
```
|
105
|
+
|
106
|
+
### stats-v1.2 [BR, EUNE, EUW, LAN, LAS, NA, OCE]
|
107
|
+
|
108
|
+
```ruby
|
109
|
+
# GET /api/lol/{region}/v1.2/stats/by-summoner/{summonerId}/ranked Get ranked stats by summoner ID. Includes statistics for Twisted Treeline and Summoner's Rift. (REST)
|
110
|
+
Outrageous::Stats.new(api_key: 'your-truly-truly-truly-outrageously-api-key').player_ranked_by_season(summoner_id, season)
|
111
|
+
|
112
|
+
# GET /api/lol/{region}/v1.2/stats/by-summoner/{summonerId}/summary Get player stats summaries by summoner ID. One summary is returned per queue type. (REST)
|
113
|
+
Outrageous::Stats.new(api_key: 'your-truly-truly-truly-outrageously-api-key').player_summary_by_season(summoner_id, season)
|
114
|
+
|
115
|
+
```
|
116
|
+
|
117
|
+
### summoner-v1.3 [BR, EUNE, EUW, LAN, LAS, NA, OCE]
|
118
|
+
|
119
|
+
Pleas keep in mind that the api limits 40 elements per request.
|
120
|
+
|
121
|
+
```ruby
|
122
|
+
# GET /api/lol/{region}/v1.3/summoner/by-name/{summonerNames} Get summoner objects mapped by standardized summoner name for a given list of summoner names or standardized summoner names (REST)
|
123
|
+
Outrageous::Summoner.new(api_key: 'your-truly-truly-truly-outrageously-api-key').find_by_names([summoner_name1, summoner_name2, ...])
|
124
|
+
|
125
|
+
# GET /api/lol/{region}/v1.3/summoner/{summonerIds} Get summoner objects mapped by summoner ID for a given list of summoner IDs (REST)
|
126
|
+
Outrageous::Summoner.new(api_key: 'your-truly-truly-truly-outrageously-api-key').find_by_ids([summoner_id1, summoner_id2, ...])
|
127
|
+
|
128
|
+
# GET /api/lol/{region}/v1.3/summoner/{summonerIds}/masteries Get mastery pages mapped by summoner ID for a given list of summoner IDs (REST)
|
129
|
+
Outrageous::Summoner.new(api_key: 'your-truly-truly-truly-outrageously-api-key').find_masteries([summoner_id1, summoner_id2, ...])
|
130
|
+
|
131
|
+
# GET /api/lol/{region}/v1.3/summoner/{summonerIds}/name Get summoner names mapped by summoner ID for a given list of summoner IDs (REST)
|
132
|
+
Outrageous::Summoner.new(api_key: 'your-truly-truly-truly-outrageously-api-key').find_names([summoner_id1, summoner_id2, ...])
|
133
|
+
|
134
|
+
# GET /api/lol/{region}/v1.3/summoner/{summonerIds}/runes Get rune pages mapped by summoner ID for a given list of summoner IDs (REST)
|
135
|
+
Outrageous::Summoner.new(api_key: 'your-truly-truly-truly-outrageously-api-key').find_runes([summoner_id1, summoner_id2, ...])
|
136
|
+
```
|
137
|
+
|
138
|
+
### team-v2.2 [BR, EUNE, EUW, LAN, LAS, NA, OCE, RU, TR]
|
139
|
+
|
140
|
+
```ruby
|
141
|
+
# GET /api/lol/{region}/v2.2/team/by-summoner/{summonerId} Retrieves teams for given summoner ID. (REST)
|
142
|
+
Outrageous::Team.new(api_key: 'your-truly-truly-truly-outrageously-api-key').find_by_summoner_id(summoner_id)
|
143
|
+
|
144
|
+
# GET /api/lol/{region}/v2.2/team/{teamIds} Get teams mapped by team ID for a given list of team IDs. (REST)
|
145
|
+
Outrageous::Team.new(api_key: 'your-truly-truly-truly-outrageously-api-key').find_by_ids([team_id1, team_id2, ...])
|
146
|
+
```
|
147
|
+
|
148
|
+
## F.A.Q
|
149
|
+
|
150
|
+
* **_The API version has changed, you haven't updated the gem, what now?_** By default, Outrageous load the last API version. If you need to change it, pass the attribute ```version: 'vX.X'``` when initializing.
|
151
|
+
* **_Why initialize an object with each request?_** I just wanted this gem to be multiuser, so it doesn't has to been globally initialized.
|
152
|
+
* **_Responses in a hash looks ugly to me, why don't instantiate a ruby object?_** Maybe because I'm a bit lazy. Nah, just kidding (not really), I've been using several APIs and I really think that this system takes less maintainace and prevents the gem from being broken when the api is updated.
|
153
|
+
* **_How do I access/find the attribute X from the Y resource? What options can I pass to the Z method? ANSWER OR DIE FAGGOT_** Please, read the API official [documentation](https://developer.riotgames.com/api/methods), probably you know more about the API than me.
|
154
|
+
|
155
|
+
## Final comments
|
156
|
+
|
157
|
+
And thats's all, play with this outrageous gem, break it and remember:
|
158
|
+
|
159
|
+
> THEY CAN'T SAY NO WHEN THEY ARE STUNNED.
|
160
|
+
|
161
|
+
## Contributing to Outrageous
|
162
|
+
|
163
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
164
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
165
|
+
* Fork the project.
|
166
|
+
* Start a feature/bugfix branch.
|
167
|
+
* Commit and push until you are happy with your contribution.
|
168
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
169
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
170
|
+
|
171
|
+
## Copyright
|
172
|
+
|
173
|
+
Copyright (c) 2014 xxswingxx. See LICENSE.txt for
|
174
|
+
further details.
|
175
|
+
|
data/lib/outrageous.rb
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
require 'ostruct'
|
2
|
+
|
3
|
+
%w(base champion game league stats summoner team).each { |filename| require "outrageous/#{filename}" }
|
4
|
+
%w(base champion item mastery rune summoner_spell).each { |filename| require "outrageous/static_data/#{filename}" }
|
5
|
+
|
6
|
+
module Outrageous
|
7
|
+
|
8
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'httparty'
|
2
|
+
require 'json'
|
3
|
+
require 'debugger'
|
4
|
+
|
5
|
+
module Outrageous
|
6
|
+
|
7
|
+
class Base
|
8
|
+
include HTTParty
|
9
|
+
|
10
|
+
base_uri 'https://prod.api.pvp.net'
|
11
|
+
|
12
|
+
CHAMPION_VERSION = 'v1.1'
|
13
|
+
GAME_VERSION = 'v1.3'
|
14
|
+
LEAGUE_VERSION = 'v2.3'
|
15
|
+
STATS_VERSION = 'v1.2'
|
16
|
+
STATIC_DATA_VERSION = 'v1'
|
17
|
+
SUMMONER_VERSION = 'v1.3'
|
18
|
+
TEAM_VERSION = 'v2.2'
|
19
|
+
|
20
|
+
attr_accessor :region, :api_key, :version, :response, :status
|
21
|
+
|
22
|
+
def initialize(attributes = {})
|
23
|
+
attributes.each do |name, value|
|
24
|
+
send("#{name}=", value) if respond_to?(name)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def region
|
29
|
+
'euw' if @region.nil? || @region.empty?
|
30
|
+
end
|
31
|
+
|
32
|
+
protected
|
33
|
+
def respond(response)
|
34
|
+
self.status = response.code
|
35
|
+
self.response = response.parsed_response
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Outrageous
|
2
|
+
|
3
|
+
class League < Base
|
4
|
+
|
5
|
+
def get_leagues_with_team_by_summoner_id(summoner_id)
|
6
|
+
respond self.class.get("/api/lol/#{region}/#{version || LEAGUE_VERSION}/league/by-summoner/#{summoner_id}", query: { api_key: api_key })
|
7
|
+
end
|
8
|
+
|
9
|
+
def get_leagues_entry_by_summoner_id(summoner_id)
|
10
|
+
respond self.class.get("/api/lol/#{region}/#{version || LEAGUE_VERSION}/league/by-summoner/#{summoner_id}/entry", query: { api_key: api_key })
|
11
|
+
end
|
12
|
+
|
13
|
+
def get_leagues_by_team_id(team_id)
|
14
|
+
respond self.class.get("/api/lol/#{region}/#{version || LEAGUE_VERSION}/league/by-team/#{team_id}", query: { api_key: api_key })
|
15
|
+
end
|
16
|
+
|
17
|
+
def get_leagues_entry_by_team_id(team_id)
|
18
|
+
respond self.class.get("/api/lol/#{region}/#{version || LEAGUE_VERSION}/league/by-team/#{team_id}/entry", query: { api_key: api_key })
|
19
|
+
end
|
20
|
+
|
21
|
+
def get_challenger_solo_q()
|
22
|
+
get_challenger_info('RANKED_SOLO_5_X_5')
|
23
|
+
end
|
24
|
+
|
25
|
+
def get_challenger_team_3_vs_3()
|
26
|
+
get_challenger_info('RANKED_TEAM_3_X_3')
|
27
|
+
end
|
28
|
+
|
29
|
+
def get_challenger_team_5_vs_5()
|
30
|
+
get_challenger_info('RANKED_TEAM_5_X_5')
|
31
|
+
end
|
32
|
+
|
33
|
+
def get_challenger_info(type)
|
34
|
+
respond self.class.get("/api/lol/#{region}/#{version || LEAGUE_VERSION}/league/challenger", query: { api_key: api_key, type: type })
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
@@ -0,0 +1,54 @@
|
|
1
|
+
###########################################################################
|
2
|
+
# Base class to retrieve information about champions, items, masteries,
|
3
|
+
# realm, runes and summoner spells.
|
4
|
+
# Example usage:
|
5
|
+
# client = Outrageous::Champion.new(api_key: 'xxxxxxxxxxxxxxxxxxxxx')
|
6
|
+
# client.all
|
7
|
+
# client.find 1
|
8
|
+
###########################################################################
|
9
|
+
|
10
|
+
module Outrageous
|
11
|
+
|
12
|
+
module StaticData
|
13
|
+
class Base < Outrageous::Base
|
14
|
+
|
15
|
+
# List elements
|
16
|
+
def all(options = {})
|
17
|
+
respond self.class.get("/api/lol/static-data/#{region}/#{version || STATIC_DATA_VERSION}/#{self.class.api_model}", query: { api_key: api_key, version: options[:version], self.class.data_key => options[self.class.data_key.to_s], locale: options[:locale] })
|
18
|
+
end
|
19
|
+
|
20
|
+
# Show a specific element
|
21
|
+
def find(id, options = {})
|
22
|
+
respond self.class.get("/api/lol/static-data/#{region}/#{version || STATIC_DATA_VERSION}/#{self.class.api_model}/#{id}", query: { api_key: api_key, version: options[:version], self.class.data_key => options[self.class.data_key.to_s], locale: options[:locale] })
|
23
|
+
end
|
24
|
+
|
25
|
+
protected
|
26
|
+
def self.api_model(klass)
|
27
|
+
instance_eval <<-END
|
28
|
+
def api_model
|
29
|
+
'#{klass}'
|
30
|
+
end
|
31
|
+
END
|
32
|
+
class_eval <<-END
|
33
|
+
def api_model
|
34
|
+
'#{klass}'
|
35
|
+
end
|
36
|
+
END
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.data_key(key)
|
40
|
+
instance_eval <<-END
|
41
|
+
def data_key
|
42
|
+
'#{key}'
|
43
|
+
end
|
44
|
+
END
|
45
|
+
class_eval <<-END
|
46
|
+
def data_key
|
47
|
+
'#{key}'
|
48
|
+
end
|
49
|
+
END
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Outrageous
|
2
|
+
|
3
|
+
class Stats < Base
|
4
|
+
|
5
|
+
def player_ranked_by_season(summoner_id, season = 4)
|
6
|
+
respond self.class.get("/api/lol/#{region}/#{version || STATS_VERSION}/stats/by-summoner/#{summoner_id}/ranked", query: { api_key: api_key, season: "SEASON#{season}" })
|
7
|
+
end
|
8
|
+
|
9
|
+
def player_summary_by_season(summoner_id, season = 4)
|
10
|
+
respond self.class.get("/api/lol/#{region}/#{version || STATS_VERSION}/stats/by-summoner/#{summoner_id}/summary", query: { api_key: api_key, season: "SEASON#{season}" })
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Outrageous
|
2
|
+
|
3
|
+
class Summoner < Base
|
4
|
+
|
5
|
+
def find_by_names(summoner_names = [])
|
6
|
+
summoner_names = [summoner_names] if !summoner_names.is_a? Array
|
7
|
+
respond self.class.get("/api/lol/#{region}/#{version || SUMMONER_VERSION}/summoner/by-name/#{summoner_names.join(',')}", query: { api_key: api_key })
|
8
|
+
end
|
9
|
+
|
10
|
+
def find_by_ids(summoner_ids = [])
|
11
|
+
summoner_ids = [summoner_ids] if !summoner_ids.is_a? Array
|
12
|
+
respond self.class.get("/api/lol/#{region}/#{version || SUMMONER_VERSION}/summoner/#{summoner_ids.join(',')}", query: { api_key: api_key })
|
13
|
+
end
|
14
|
+
|
15
|
+
def find_masteries(summoner_ids = [])
|
16
|
+
summoner_ids = [summoner_ids] if !summoner_ids.is_a? Array
|
17
|
+
respond self.class.get("/api/lol/#{region}/#{version || SUMMONER_VERSION}/summoner/#{summoner_ids.join(',')}/masteries", query: { api_key: api_key })
|
18
|
+
end
|
19
|
+
|
20
|
+
def find_names(summoner_ids = [])
|
21
|
+
summoner_ids = [summoner_ids] if !summoner_ids.is_a? Array
|
22
|
+
respond self.class.get("/api/lol/#{region}/#{version || SUMMONER_VERSION}/summoner/#{summoner_ids.join(',')}/name", query: { api_key: api_key })
|
23
|
+
end
|
24
|
+
|
25
|
+
def find_runes(summoner_ids = [])
|
26
|
+
summoner_ids = [summoner_ids] if !summoner_ids.is_a? Array
|
27
|
+
respond self.class.get("/api/lol/#{region}/#{version || SUMMONER_VERSION}/summoner/#{summoner_ids.join(',')}/runes", query: { api_key: api_key })
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Outrageous
|
2
|
+
|
3
|
+
class Team < Base
|
4
|
+
|
5
|
+
# GET /api/lol/{region}/v2.2/team/by-summoner/{summonerId} Retrieves teams for given summoner ID. (REST)
|
6
|
+
def find_by_summoner_id(summoner_id)
|
7
|
+
respond self.class.get("/api/lol/#{region}/#{version || TEAM_VERSION}/team/by-summoner/#{summoner_id}", query: { api_key: api_key })
|
8
|
+
end
|
9
|
+
|
10
|
+
# GET /api/lol/{region}/v2.2/team/{teamIds} Get teams mapped by team ID for a given list of team IDs. (REST)
|
11
|
+
def find_by_ids(teams_ids)
|
12
|
+
teams_ids = [teams_ids] if !teams_ids.is_a? Array
|
13
|
+
respond self.class.get("/api/lol/#{region}/#{version || TEAM_VERSION}/team/#{teams_ids.join(',')}", query: { api_key: api_key })
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
metadata
ADDED
@@ -0,0 +1,147 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: outrageous
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- xxswingxx
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-03-31 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: httparty
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: shoulda
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rdoc
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.12'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.12'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: jeweler
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 2.0.1
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 2.0.1
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: simplecov
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
description: A ruby wrapper for the official League of Legends API in an outrageous
|
98
|
+
package
|
99
|
+
email: vidadelaempresa@gmail.com
|
100
|
+
executables: []
|
101
|
+
extensions: []
|
102
|
+
extra_rdoc_files:
|
103
|
+
- LICENSE.txt
|
104
|
+
- README.md
|
105
|
+
files:
|
106
|
+
- LICENSE.txt
|
107
|
+
- README.md
|
108
|
+
- lib/outrageous.rb
|
109
|
+
- lib/outrageous/base.rb
|
110
|
+
- lib/outrageous/champion.rb
|
111
|
+
- lib/outrageous/game.rb
|
112
|
+
- lib/outrageous/league.rb
|
113
|
+
- lib/outrageous/static_data/base.rb
|
114
|
+
- lib/outrageous/static_data/champion.rb
|
115
|
+
- lib/outrageous/static_data/item.rb
|
116
|
+
- lib/outrageous/static_data/mastery.rb
|
117
|
+
- lib/outrageous/static_data/realm.rb
|
118
|
+
- lib/outrageous/static_data/rune.rb
|
119
|
+
- lib/outrageous/static_data/summoner_spell.rb
|
120
|
+
- lib/outrageous/stats.rb
|
121
|
+
- lib/outrageous/summoner.rb
|
122
|
+
- lib/outrageous/team.rb
|
123
|
+
homepage: http://github.com/xxswingxx/outrageous
|
124
|
+
licenses:
|
125
|
+
- MIT
|
126
|
+
metadata: {}
|
127
|
+
post_install_message:
|
128
|
+
rdoc_options: []
|
129
|
+
require_paths:
|
130
|
+
- lib
|
131
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: '0'
|
136
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
141
|
+
requirements: []
|
142
|
+
rubyforge_project:
|
143
|
+
rubygems_version: 2.2.2
|
144
|
+
signing_key:
|
145
|
+
specification_version: 4
|
146
|
+
summary: A ruby wrapper for the official League of Legends API in an outrageous package
|
147
|
+
test_files: []
|