riot_lol_api 0.3.1 → 0.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e29d98a8f7702340c689e953c3353462678ab813
4
- data.tar.gz: b61b304f4e4daf2960a65c725ccab92f1f60f3b0
3
+ metadata.gz: 75c6f27bdeed2052301f7f5f39794e78725988aa
4
+ data.tar.gz: 5f6888386b098d2bd10d053e39d10edaa825bbc8
5
5
  SHA512:
6
- metadata.gz: 0f8af68b5e1994ede72cf635f9ce0ea9cf113bcf86b253a41c98346b1ed8292772f90c9429b4e43aa5a0de81c9191193e6a80bf0e82776b688841e431f7f19f4
7
- data.tar.gz: faf1e452651caf3df979aaaca73f047fb3ebf9965574c7fcb17435959a7d224be2bb7979acea55fb8f130b378ca3f6d25d358754cd112dad4f5727e76afc676a
6
+ metadata.gz: b7014966dc977243a2872d5704f83790500188225fc1cafced42d451a710b5ffd94e864ae4ce8c3c4352dc0d71508a223164d8d1f3b465385f1b9a698da7926f
7
+ data.tar.gz: ed201bda5e9ad41fa29682e25a38f66c263bb9111ca28073b92321d5e525e6fd202bb376a445c1765d62e8051ef8beb87bc34d1d9134e31a084eb6de856216d1
data/README.md CHANGED
@@ -13,7 +13,7 @@
13
13
 
14
14
  ## Status
15
15
 
16
- ###V 0.2.0
16
+ ###V 0.3.2
17
17
 
18
18
  ```
19
19
  - champion-v1.2 NO IMPLEMENT
@@ -103,6 +103,7 @@ summoner.current_game
103
103
 
104
104
  ## Change logs
105
105
 
106
+ - v 0.3.2 : Add get_summoners_by_id method (pull request by [aeipownu](https://github.com/aeipownu))
106
107
  - v 0.3.1 : Add get match by id methods
107
108
  - v 0.3.0 : Add current game and featured games methods
108
109
  - v 0.2.0 : Add method matchhistory and update SEASON2015
@@ -58,7 +58,6 @@ module RiotLolApi
58
58
 
59
59
  # Set domaine url
60
60
  domaine_url = "#{domaine}.#{overide_base_uri||BASE_URL_API}"
61
-
62
61
  response = HTTParty.get("https://#{domaine_url}#{url}", :query => data)
63
62
  case response.code
64
63
  when 200
@@ -98,9 +97,22 @@ module RiotLolApi
98
97
  end
99
98
  end
100
99
 
100
+ def get_summoners_by_id id
101
+ response = Client.get("#{@region}/v1.4/summoner/#{id}",@region)
102
+ unless response.nil?
103
+ summoners = Array.new
104
+ response.each do |id, data|
105
+ summoners << RiotLolApi::Model::Summoner.new(response[data['id'].to_s].to_symbol.merge({:region => @region}))
106
+ end
107
+ summoners
108
+ else
109
+ nil
110
+ end
111
+ end
112
+
101
113
  # CHAMPION
102
114
 
103
- def get_champion_by_id id, data = nil, locale = 'fr_FR'
115
+ def get_champion_by_id id, data = nil, locale = 'en_US'
104
116
  if data.nil?
105
117
  data = {:locale => locale}
106
118
  else
@@ -115,7 +127,7 @@ module RiotLolApi
115
127
  end
116
128
  end
117
129
 
118
- def get_all_champions data = nil, sort_id = 'false', locale = 'fr_FR'
130
+ def get_all_champions data = nil, sort_id = 'false', locale = 'en_US'
119
131
  if data.nil?
120
132
  data = {:locale => locale, :dataById => sort_id}
121
133
  else
@@ -136,7 +148,7 @@ module RiotLolApi
136
148
 
137
149
  # ITEM
138
150
 
139
- def get_all_items data = nil, locale = 'fr_FR'
151
+ def get_all_items data = nil, locale = 'en_US'
140
152
  if data.nil?
141
153
  data = {:locale => locale}
142
154
  else
@@ -155,7 +167,7 @@ module RiotLolApi
155
167
  end
156
168
  end
157
169
 
158
- def get_item_by_id id, data = nil, locale = 'fr_FR'
170
+ def get_item_by_id id, data = nil, locale = 'en_US'
159
171
  if data.nil?
160
172
  data = {:locale => locale}
161
173
  else
@@ -172,7 +184,7 @@ module RiotLolApi
172
184
 
173
185
  # MASTERY
174
186
 
175
- def get_all_masteries data = nil, locale = 'fr_FR'
187
+ def get_all_masteries data = nil, locale = 'en_US'
176
188
  if data.nil?
177
189
  data = {:locale => locale}
178
190
  else
@@ -191,7 +203,7 @@ module RiotLolApi
191
203
  end
192
204
  end
193
205
 
194
- def get_mastery_by_id id, data = nil, locale = 'fr_FR'
206
+ def get_mastery_by_id id, data = nil, locale = 'en_US'
195
207
  if data.nil?
196
208
  data = {:locale => locale}
197
209
  else
@@ -208,7 +220,7 @@ module RiotLolApi
208
220
 
209
221
  # RUNE
210
222
 
211
- def get_all_runes data = nil, locale = 'fr_FR'
223
+ def get_all_runes data = nil, locale = 'en_US'
212
224
  if data.nil?
213
225
  data = {:locale => locale}
214
226
  else
@@ -227,7 +239,7 @@ module RiotLolApi
227
239
  end
228
240
  end
229
241
 
230
- def get_rune_by_id id, data = nil, locale = 'fr_FR'
242
+ def get_rune_by_id id, data = nil, locale = 'en_US'
231
243
  if data.nil?
232
244
  data = {:locale => locale}
233
245
  else
@@ -244,7 +256,7 @@ module RiotLolApi
244
256
 
245
257
  # SUMMONER SPELL
246
258
 
247
- def get_all_summoner_spells data = nil, sort_id = 'false', locale = 'fr_FR'
259
+ def get_all_summoner_spells data = nil, sort_id = 'false', locale = 'en_US'
248
260
  if data.nil?
249
261
  data = {:locale => locale, :dataById => sort_id}
250
262
  else
@@ -263,7 +275,7 @@ module RiotLolApi
263
275
  end
264
276
  end
265
277
 
266
- def get_summoner_spell_by_id id, data = nil, locale = 'fr_FR'
278
+ def get_summoner_spell_by_id id, data = nil, locale = 'en_US'
267
279
  if data.nil?
268
280
  data = {:locale => locale}
269
281
  else
@@ -11,4 +11,4 @@ module RiotLolApi
11
11
 
12
12
  end
13
13
  end
14
- end
14
+ end
@@ -1,3 +1,3 @@
1
1
  module RiotLolApi
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riot_lol_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - francois_blanchard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-15 00:00:00.000000000 Z
11
+ date: 2015-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -247,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
247
247
  version: '0'
248
248
  requirements: []
249
249
  rubyforge_project:
250
- rubygems_version: 2.2.2
250
+ rubygems_version: 2.4.8
251
251
  signing_key:
252
252
  specification_version: 4
253
253
  summary: Riot games api