riot_lol_api 0.1.12 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +86 -69
- data/curl_import.rb +226 -0
- data/lib/core_ext/hash.rb +1 -1
- data/lib/riot_lol_api/{client.rb → clients.rb} +9 -7
- data/lib/riot_lol_api/helper_classes.rb +22 -0
- data/lib/riot_lol_api/model/{aggregated_stat.rb → aggregated_stats.rb} +0 -0
- data/lib/riot_lol_api/model/{altimage.rb → altimages.rb} +0 -0
- data/lib/riot_lol_api/model/{block.rb → blocks.rb} +2 -2
- data/lib/riot_lol_api/model/champions.rb +23 -0
- data/lib/riot_lol_api/model/class_base.rb +14 -0
- data/lib/riot_lol_api/model/creepspermindeltas.rb +14 -0
- data/lib/riot_lol_api/model/csdiffpermindeltas.rb +14 -0
- data/lib/riot_lol_api/model/damagetakendiffpermindeltas.rb +13 -0
- data/lib/riot_lol_api/model/damagetakenpermindeltas.rb +14 -0
- data/lib/riot_lol_api/model/{datum.rb → data.rb} +0 -0
- data/lib/riot_lol_api/model/effects.rb +14 -0
- data/lib/riot_lol_api/model/{entry.rb → entries.rb} +0 -0
- data/lib/riot_lol_api/model/{fellow_player.rb → fellow_players.rb} +0 -0
- data/lib/riot_lol_api/model/{game.rb → games.rb} +3 -3
- data/lib/riot_lol_api/model/goldpermindeltas.rb +14 -0
- data/lib/riot_lol_api/model/{gold.rb → golds.rb} +0 -0
- data/lib/riot_lol_api/model/{image.rb → images.rb} +0 -0
- data/lib/riot_lol_api/model/{info.rb → infos.rb} +0 -0
- data/lib/riot_lol_api/model/{item.rb → items.rb} +4 -3
- data/lib/riot_lol_api/model/{league.rb → leagues.rb} +3 -3
- data/lib/riot_lol_api/model/{leveltip.rb → leveltips.rb} +0 -0
- data/lib/riot_lol_api/model/{map.rb → maps.rb} +0 -0
- data/lib/riot_lol_api/model/{mastery.rb → masteries.rb} +0 -0
- data/lib/riot_lol_api/model/matches.rb +14 -0
- data/lib/riot_lol_api/model/{mini_sery.rb → mini_series.rb} +0 -0
- data/lib/riot_lol_api/model/{page.rb → pages.rb} +3 -3
- data/lib/riot_lol_api/model/participantidentities.rb +13 -0
- data/lib/riot_lol_api/model/participants.rb +14 -0
- data/lib/riot_lol_api/model/{passive.rb → passives.rb} +2 -2
- data/lib/riot_lol_api/model/{player_stat_rank.rb → player_stat_ranks.rb} +2 -2
- data/lib/riot_lol_api/model/{player_stat_summary.rb → player_stat_summaries.rb} +2 -2
- data/lib/riot_lol_api/model/players.rb +13 -0
- data/lib/riot_lol_api/model/{recommended.rb → recommendeds.rb} +2 -2
- data/lib/riot_lol_api/model/{rune.rb → runes.rb} +0 -0
- data/lib/riot_lol_api/model/{skin.rb → skins.rb} +0 -0
- data/lib/riot_lol_api/model/{slot.rb → slots.rb} +0 -0
- data/lib/riot_lol_api/model/{spell.rb → spells.rb} +5 -5
- data/lib/riot_lol_api/model/{stat.rb → stats.rb} +0 -0
- data/lib/riot_lol_api/model/{summoner.rb → summoners.rb} +42 -11
- data/lib/riot_lol_api/model/timelines.rb +16 -0
- data/lib/riot_lol_api/model/{var.rb → vars.rb} +0 -0
- data/lib/riot_lol_api/model/xpdiffpermindeltas.rb +14 -0
- data/lib/riot_lol_api/model/xppermindeltas.rb +14 -0
- data/lib/riot_lol_api/models.rb +8 -0
- data/lib/riot_lol_api/version.rb +1 -1
- data/lib/riot_lol_api.rb +4 -2
- data/riot_lol_api.gemspec +6 -4
- data/spec/factories/game.rb +6 -6
- data/spec/factories/page.rb +1 -1
- data/spec/factories/summoner.rb +3 -3
- data/spec/mock_response/get_all_champions_by_ids.json +3 -3
- data/spec/mock_response/get_all_champions_by_ids_all_data.json +3 -3
- data/spec/mock_response/get_all_item.json +3 -3
- data/spec/mock_response/get_all_masteries.json +3 -3
- data/spec/mock_response/get_all_runes.json +3 -3
- data/spec/mock_response/get_all_summoner_spells.json +3 -3
- data/spec/mock_response/get_all_summoner_spells_by_ids.json +3 -3
- data/spec/mock_response/get_champion_by_id.json +2 -2
- data/spec/mock_response/get_champion_by_id_all_data.json +3 -3
- data/spec/mock_response/get_item_by_id.json +3 -3
- data/spec/mock_response/get_mastery_by_id.json +3 -3
- data/spec/mock_response/get_match_by_id.json +13 -0
- data/spec/mock_response/get_match_history.json +13 -0
- data/spec/mock_response/get_player_league.json +5 -3
- data/spec/mock_response/get_player_stat_ranked.json +4 -3
- data/spec/mock_response/get_player_stat_summaries.json +5 -5
- data/spec/mock_response/get_realm.json +4 -4
- data/spec/mock_response/get_rune_by_id.json +2 -2
- data/spec/mock_response/get_summoner_by_id.json +5 -4
- data/spec/mock_response/get_summoner_by_name.json +5 -4
- data/spec/mock_response/get_summoner_games_by_id.json +4 -3
- data/spec/mock_response/get_summoner_masteries_by_id.json +5 -4
- data/spec/mock_response/get_summoner_runes_by_id.json +5 -4
- data/spec/mock_response/get_summoner_spell_by_id.json +3 -3
- data/spec/mock_response/get_version.json +4 -4
- data/spec/mock_response/summoner.json +13 -0
- data/spec/riot_lol_api_spec.rb +559 -608
- metadata +83 -33
- data/lib/riot_lol_api/model/champion.rb +0 -23
- data/lib/riot_lol_api/model.rb +0 -8
data/lib/core_ext/hash.rb
CHANGED
@@ -3,8 +3,10 @@ require 'json'
|
|
3
3
|
|
4
4
|
module RiotLolApi
|
5
5
|
class Client
|
6
|
-
# Constant URL
|
7
6
|
|
7
|
+
include RiotLolApi::HelperClass
|
8
|
+
|
9
|
+
# Constant URL
|
8
10
|
BASE_URL_API = "api.pvp.net/api/lol/"
|
9
11
|
|
10
12
|
# attr
|
@@ -34,7 +36,7 @@ module RiotLolApi
|
|
34
36
|
|
35
37
|
# TO DO
|
36
38
|
# Set callback to get realm constants
|
37
|
-
#
|
39
|
+
#
|
38
40
|
|
39
41
|
def self.get url, domaine,data = nil
|
40
42
|
unless RiotLolApi::TOKEN.nil?
|
@@ -104,7 +106,7 @@ module RiotLolApi
|
|
104
106
|
else
|
105
107
|
data.merge!({:locale => locale})
|
106
108
|
end
|
107
|
-
|
109
|
+
|
108
110
|
response = Client.get("static-data/#{@region}/v1.2/champion/#{id}","global",data)
|
109
111
|
unless response.nil?
|
110
112
|
RiotLolApi::Model::Champion.new(response.to_symbol)
|
@@ -133,7 +135,7 @@ module RiotLolApi
|
|
133
135
|
end
|
134
136
|
|
135
137
|
# ITEM
|
136
|
-
|
138
|
+
|
137
139
|
def get_all_items data = nil, locale = 'fr_FR'
|
138
140
|
if data.nil?
|
139
141
|
data = {:locale => locale}
|
@@ -169,7 +171,7 @@ module RiotLolApi
|
|
169
171
|
end
|
170
172
|
|
171
173
|
# MASTERY
|
172
|
-
|
174
|
+
|
173
175
|
def get_all_masteries data = nil, locale = 'fr_FR'
|
174
176
|
if data.nil?
|
175
177
|
data = {:locale => locale}
|
@@ -205,7 +207,7 @@ module RiotLolApi
|
|
205
207
|
end
|
206
208
|
|
207
209
|
# RUNE
|
208
|
-
|
210
|
+
|
209
211
|
def get_all_runes data = nil, locale = 'fr_FR'
|
210
212
|
if data.nil?
|
211
213
|
data = {:locale => locale}
|
@@ -286,4 +288,4 @@ module RiotLolApi
|
|
286
288
|
end
|
287
289
|
|
288
290
|
end
|
289
|
-
end
|
291
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module RiotLolApi
|
2
|
+
module HelperClass
|
3
|
+
|
4
|
+
# Instance methods
|
5
|
+
|
6
|
+
def list_methods
|
7
|
+
self.class.instance_methods(false).map{|i| i.to_sym}
|
8
|
+
end
|
9
|
+
|
10
|
+
# Class methods
|
11
|
+
|
12
|
+
def self.included(object)
|
13
|
+
object.extend(ClassMethods)
|
14
|
+
end
|
15
|
+
|
16
|
+
module ClassMethods
|
17
|
+
def list_methods
|
18
|
+
self.instance_methods(false).map{|i| i.to_sym}
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
File without changes
|
File without changes
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'riot_lol_api/model/stats'
|
2
|
+
require 'riot_lol_api/model/recommendeds'
|
3
|
+
require 'riot_lol_api/model/images'
|
4
|
+
require 'riot_lol_api/model/spells'
|
5
|
+
require 'riot_lol_api/model/infos'
|
6
|
+
require 'riot_lol_api/model/passives'
|
7
|
+
require 'riot_lol_api/model/skins'
|
8
|
+
require 'riot_lol_api/model/data'
|
9
|
+
|
10
|
+
module RiotLolApi
|
11
|
+
module Model
|
12
|
+
class Champion
|
13
|
+
|
14
|
+
def initialize(options = {})
|
15
|
+
options.each do |key, value|
|
16
|
+
self.class.send(:attr_accessor, key.to_sym)
|
17
|
+
instance_variable_set("@#{key}", value)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,5 +1,5 @@
|
|
1
|
-
require 'riot_lol_api/model/
|
2
|
-
require 'riot_lol_api/model/
|
1
|
+
require 'riot_lol_api/model/fellow_players'
|
2
|
+
require 'riot_lol_api/model/stats'
|
3
3
|
|
4
4
|
module RiotLolApi
|
5
5
|
module Model
|
@@ -16,4 +16,4 @@ module RiotLolApi
|
|
16
16
|
|
17
17
|
end
|
18
18
|
end
|
19
|
-
end
|
19
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,5 +1,6 @@
|
|
1
|
-
require 'riot_lol_api/model/
|
2
|
-
require 'riot_lol_api/model/
|
1
|
+
require 'riot_lol_api/model/golds'
|
2
|
+
require 'riot_lol_api/model/effects'
|
3
|
+
require 'riot_lol_api/model/maps'
|
3
4
|
|
4
5
|
module RiotLolApi
|
5
6
|
module Model
|
@@ -14,4 +15,4 @@ module RiotLolApi
|
|
14
15
|
|
15
16
|
end
|
16
17
|
end
|
17
|
-
end
|
18
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
require 'riot_lol_api/model/
|
2
|
-
require 'riot_lol_api/model/
|
1
|
+
require 'riot_lol_api/model/entries'
|
2
|
+
require 'riot_lol_api/model/mini_series'
|
3
3
|
|
4
4
|
module RiotLolApi
|
5
5
|
module Model
|
@@ -14,4 +14,4 @@ module RiotLolApi
|
|
14
14
|
|
15
15
|
end
|
16
16
|
end
|
17
|
-
end
|
17
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|