league_api 0.3.0 → 0.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 39eb0600f78f3d6266ac57b6589d67b128bdb11f
4
- data.tar.gz: 10891964223dc9dd62e72890c00fb46e7d7e8c45
3
+ metadata.gz: 9f217571920f14c9e7d4e2e58bcd38658c5c1525
4
+ data.tar.gz: 9586757d2d088ded9922b83f05667d38957736e7
5
5
  SHA512:
6
- metadata.gz: e72032b3c1e0848f19cb6f0ba3600f0f2c6858fe783c2c21a7e17b9da9dbc9f3c999980e47940ebf8c28b3a3608a8e1eccdd3b183e8efc8624026941abaf320e
7
- data.tar.gz: 651bc9cf6cdaddf662b502e31ef86e53d52dc17a43d6577a12def9119ede43f8716ffad0633af3251b1de1c6f1b8ab24e67d365a84a8225d3370d05344606e3f
6
+ metadata.gz: 985b77861f54e564b8fd2bf2e54695670ef4d22bcfc989975c8fca92bf19cbb4054beeaa78846ac688e714f578dbe9fe707269b0a227b1c03978737b1ea27490
7
+ data.tar.gz: e0b8c68070933fa9fb5bb6c0d74b841d09e34f863dfa391b884b21313f11ceffcc6f5cb6a0ccf5e0162a9569297042797ba6c6c4eb62ead0515cebb9899ba33a
@@ -23,7 +23,7 @@ module LeagueApi
23
23
  def self.requests
24
24
  %w( get_list get_free_champs get_by_id(champion_id) )
25
25
  end
26
-
26
+
27
27
  end
28
28
 
29
29
  end
@@ -63,11 +63,11 @@ module LeagueApi
63
63
  def self.get_inverted_champion_list
64
64
  hash = get_champion_list
65
65
  r = {}
66
-
66
+
67
67
  hash.each do |e|
68
68
  r[ e[1]["id"] ] = e[0]
69
69
  end
70
-
70
+
71
71
  r
72
72
  end
73
73
 
@@ -1,7 +1,7 @@
1
1
  module LeagueApi
2
-
2
+
3
3
  class Stats
4
-
4
+
5
5
  @base_url = 'https://prod.api.pvp.net/api/lol/na/v1.3/stats/by-summoner/'
6
6
 
7
7
  def self.make_request(str, params=nil)
@@ -24,4 +24,4 @@ module LeagueApi
24
24
 
25
25
  end
26
26
 
27
- end
27
+ end
@@ -1,7 +1,7 @@
1
1
  module LeagueApi
2
2
 
3
3
  class Summoner
4
-
4
+
5
5
  @base_url = 'https://prod.api.pvp.net/api/lol/na/v1.4/summoner/'
6
6
 
7
7
  def self.make_request(str)
@@ -35,4 +35,4 @@ module LeagueApi
35
35
 
36
36
  end
37
37
 
38
- end
38
+ end
@@ -1,5 +1,5 @@
1
1
  module LeagueApi
2
-
2
+
3
3
  class Util
4
4
 
5
5
  # Takes fellow_player hash from game info and splits into team 1 and team 2 (prepend lookup team1)
@@ -21,7 +21,7 @@ module LeagueApi
21
21
  s["Largest Killing Sprees"] = game["largestKillingSpree"]
22
22
  s["Neutral Minions Killed"] = game["neutralMinionsKilled"]
23
23
  s["Largest Multikill"] = game["largestMultiKill"]
24
-
24
+
25
25
  s["Physical Damage Dealt"] = game["physicalDamageDealtPlayer"]
26
26
  s["Magic Damage Dealt"] = game["magicDamageDealtPlayer"]
27
27
  s["Physical Damage To Champions"] = game["physicalDamageDealtToChampions"]
@@ -52,4 +52,4 @@ module LeagueApi
52
52
  end
53
53
 
54
54
  end
55
- end
55
+ end
data/lib/league_api.rb CHANGED
@@ -19,16 +19,16 @@ module LeagueApi
19
19
  url = base + modifier
20
20
 
21
21
  if params
22
-
22
+
23
23
  params.each do |p|
24
24
  url << '?'+p[0]+'='+p[1]
25
25
  end
26
26
  url += '&api_key=' + @api_key
27
-
27
+
28
28
  else
29
29
 
30
30
  url += '?api_key=' + @api_key
31
-
31
+
32
32
  end
33
33
 
34
34
  uri = URI.parse(url)
@@ -39,11 +39,13 @@ module LeagueApi
39
39
  def available_requests
40
40
  c = self.constants
41
41
  requests = {}
42
-
42
+
43
+ requests[LeagueApi] = self.instance_methods.map &:to_s
44
+
43
45
  c.each do |i|
44
46
  requests[eval(i.to_s)] = eval(i.to_s).requests
45
47
  end
46
-
48
+
47
49
  requests
48
50
  end
49
51
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: league_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - DanBradbury
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-29 00:00:00.000000000 Z
11
+ date: 2014-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -28,19 +28,34 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '10.3'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: pry
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.9'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
39
53
  - !ruby/object:Gem::Version
40
- version: '0'
41
- description: 1-1 Mapping of Riot Developer APIs to a simple/convenient abstraction.
42
- Always updating to add more helpful abstractions and uses that utilize the API to
43
- the fullest
54
+ version: '0.9'
55
+ description: 1-1 Mapping of the Riot Developer APIs. Mapping is returned in a <Hash>
56
+ for convenience. Additional methods have been / will be continuously added in order
57
+ to support ease of use across a variety of use cases. The restriction is only to
58
+ properly use the rate limit and submit a PR with tests.
44
59
  email:
45
60
  - dan.luckydaisy@gmail.com
46
61
  executables: []
@@ -79,6 +94,6 @@ rubyforge_project:
79
94
  rubygems_version: 2.2.2
80
95
  signing_key:
81
96
  specification_version: 4
82
- summary: Requests to Riot Developer API
97
+ summary: Requests to Riot Developer API with Additional Utilities
83
98
  test_files: []
84
99
  has_rdoc: