league_api 0.2.1 → 0.2.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/league_api/util.rb +52 -0
  3. metadata +18 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6198bfb326c495f25e73f17066a0309ece46f6c9
4
- data.tar.gz: 871d59ac1f42225f0ba850968caed79dfc792c34
3
+ metadata.gz: 386eff665ddf691e586af060f7f960f5d1f554b7
4
+ data.tar.gz: 7df3da8cbe78e56cadcb2183f9ba0cea422c7f8c
5
5
  SHA512:
6
- metadata.gz: e602e3f6154a4ccb8a75c5fe5b882a116c3d1929c32e1404958923f4181deba48a154eff8e417c9e0f0eecc990bf546395f6c2d1220ccc2ea56bf1ec8ad393d1
7
- data.tar.gz: f5b38a3fa0a64403e2b7dfedd866fe75e120d1f7649d0c5a7c0cbae91d6ce50b1daa4725e32d30f9ddad6dc41a64b81896828cb2d0d2f49f037059ae6f7d5f74
6
+ metadata.gz: 9ec4ba4aa8bf2de5f672bf3a88409f5cfa8f3b55888ac998e8b03e4e372c7bf61389de12e58805a4721a44b4f0d9c862d2e0f202c124a86b700fa19a57d32990
7
+ data.tar.gz: 532d981c25be224d01ec5ec6113a3ec72ccfca280c9d552c7f87a29ab5083f271a60c6630e28b793e4f8f1e328dd83dec98e6c4c50a986d499f71511f0f32b52
@@ -0,0 +1,52 @@
1
+ module LeagueApi
2
+
3
+ class Util
4
+
5
+ # Takes fellow_player hash from game info and splits into team 1 and team 2 (prepend lookup team1)
6
+ def self.sort_fellow_players(hash)
7
+ hash.sort! { |x,y| x["teamId"] <=> y["teamId"]}
8
+ end
9
+
10
+ # Pass in stats from game info and get an readable stat hash to iterate on
11
+ def self.get_important_stats(hash)
12
+ s = {}
13
+ #manually add every stat we want
14
+ s["Gold Earned"] = hash["goldEarned"]
15
+ s["Minions Killed"] = hash["minionsKilled"]
16
+
17
+ s["Total Damage"] = hash["totalDamageDealt"]
18
+ s["Total Damage Taken"] = hash["totalDamageTaken"]
19
+
20
+ s["Killing Sprees"] = hash["killingSprees"]
21
+ s["Largest Killing Sprees"] = hash["largestKillingSpree"]
22
+ s["Neutral Minions Killed"] = hash["neutralMinionsKilled"]
23
+ s["Largest Multikill"] = hash["largestMultiKill"]
24
+
25
+ s["Physical Damage Dealt"] = hash["physicalDamageDealtPlayer"]
26
+ s["Magic Damage Dealt"] = hash["magicDamageDealtPlayer"]
27
+ s["Physical Damage To Champions"] = hash["physicalDamageDealtToChampions"]
28
+ s["Magic Damage To Champions"] = hash["magicDamageDealtToChampions"]
29
+ s["Total Damage To Champions"] = hash["totalDamageDealtToChampions"]
30
+ s["True Damage Dealt"] = hash["trueDamageDealtPlayer"]
31
+ s["True Damage To Champions"] = hash["trueDamageDealtToChampions"]
32
+ s["True Damage Taken"] = hash["trueDamageTaken"]
33
+ s["Physical Damage Taken"] = hash["physicalDamageTaken"]
34
+ s["Magic Damage Taken"] = hash["magicDamageTaken"]
35
+ s["Total Healing"] = hash["totalHeal"]
36
+
37
+ s["Turrets Killed"] = hash["turretsKilled"]
38
+ s["Minions Killed in Enemy Jungle"] = hash["neutralMinionsKilledEnemyJungle"]
39
+ s["Minions Killed in Your Jungle"] = hash["neutralMinionsKilledYourJungle"]
40
+ s["Gold Spent"] = hash["goldSpent"]
41
+
42
+ s["Vision Wards Purchased"] = hash["visionWardsBought"]
43
+ s["Wards Placed"] = hash["wardPlaced"]
44
+ #TODO: Needs a more accurate descriptions (milli seconds)
45
+ s["Crowd Control Dealt"] = hash["totalTimeCrowdControlDealt"]
46
+
47
+ s
48
+ end
49
+
50
+
51
+ end
52
+ end
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.2.1
4
+ version: 0.2.2
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-11 00:00:00.000000000 Z
11
+ date: 2014-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
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'
27
41
  description: 1-1 Mapping of Riot Developer APIs to a simple/convenient abstraction.
28
42
  Always updating to add more helpful abstractions and uses that utilize the API to
29
43
  the fullest
@@ -41,7 +55,8 @@ files:
41
55
  - lib/league_api/stats.rb
42
56
  - lib/league_api/summoner.rb
43
57
  - lib/league_api/team.rb
44
- homepage: https://github.com/DanBradbury/LeagueApi
58
+ - lib/league_api/util.rb
59
+ homepage: http://danbradbury.github.io/LeagueApi/
45
60
  licenses:
46
61
  - MIT
47
62
  metadata: {}