sightstone 1.2.0 → 1.3.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 +4 -4
- data/lib/sightstone/match_history.rb +4 -21
- data/lib/sightstone/modules/game_module.rb +1 -1
- metadata +2 -3
- data/lib/sightstone/exceptions.rb +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0ff32f0fedd03c1518ab574e13319e014786e26
|
4
|
+
data.tar.gz: 5f8a7eae275d434eba213ccb22ac14809b6ccbc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20979af07e6fcb8ac23bb6c3521ed92dfec3cfd74bac9c076a5cf57d94889a530ee0f8f5ccaf3e6378c4be8d98baab4d5ea41fc9a10bf165b8e5e2cb180c909b
|
7
|
+
data.tar.gz: 08deb9622105f2f66c0545ad305b06b69d4502976c0654af24f94309d9349f1bf55182267901763591457a1c3045dd2b43ca1b2078640c0a05f1cde9e163a01e
|
@@ -28,7 +28,7 @@ end
|
|
28
28
|
# @attr [Fixnum] spell2 selected summoner spell no 2
|
29
29
|
# @attr [String] subtype subtype
|
30
30
|
# @attr [Fixnum] teamId ID of the team if there is a team associated to the game
|
31
|
-
# @attr [
|
31
|
+
# @attr [Hash<String, Fixnum, Boolean>] statistics statistics of the game as a Hash: name -> value
|
32
32
|
class HistoryGame
|
33
33
|
attr_accessor :championId, :createDate, :fellowPlayers, :gameId, :gameMode, :gameType, :invalid, :level, :mapId, :spell1, :spell2, :statistics, :subType, :teamId
|
34
34
|
|
@@ -50,9 +50,9 @@ class HistoryGame
|
|
50
50
|
@mapId=data['mapId']
|
51
51
|
@spell1=data['spell1']
|
52
52
|
@spell2=data['spell2']
|
53
|
-
@statistics =
|
54
|
-
data['
|
55
|
-
@statistics
|
53
|
+
@statistics = {}
|
54
|
+
data['stats'].each do |key, stat|
|
55
|
+
@statistics[key] = stat
|
56
56
|
end
|
57
57
|
@subType=data['subType']
|
58
58
|
@teamId=data['teamId']
|
@@ -73,21 +73,4 @@ class Player
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
-
# statistical value of a game
|
77
|
-
# @attr [Fixnum] id ID of the statistical value
|
78
|
-
# @attr [String] mame name of the statistical value (example: MINIONS_KILLED)
|
79
|
-
# @attr [Fixnum] value value
|
80
|
-
class Stat
|
81
|
-
attr_accessor :id, :name, :value
|
82
|
-
|
83
|
-
def initialize(data)
|
84
|
-
@name = data['name']
|
85
|
-
@id = data['id']
|
86
|
-
@value = if data.has_key? 'value'
|
87
|
-
data['value']
|
88
|
-
else
|
89
|
-
data['count']
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
93
76
|
end
|
@@ -20,7 +20,7 @@ class GameModule < SightstoneBaseModule
|
|
20
20
|
else
|
21
21
|
summoner
|
22
22
|
end
|
23
|
-
uri = "https://prod.api.pvp.net/api/lol/#{region}/v1.
|
23
|
+
uri = "https://prod.api.pvp.net/api/lol/#{region}/v1.3/game/by-summoner/#{id}/recent"
|
24
24
|
|
25
25
|
response = _get_api_response(uri)
|
26
26
|
_parse_response(response) { |resp|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sightstone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -46,7 +46,6 @@ extra_rdoc_files: []
|
|
46
46
|
files:
|
47
47
|
- lib/sightstone.rb
|
48
48
|
- lib/sightstone/champion.rb
|
49
|
-
- lib/sightstone/exceptions.rb
|
50
49
|
- lib/sightstone/league.rb
|
51
50
|
- lib/sightstone/masterybook.rb
|
52
51
|
- lib/sightstone/match_history.rb
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module Sightstone
|
2
|
-
|
3
|
-
# Base class for exceptions raised by the gem
|
4
|
-
class SightstoneApiException < Exception; end
|
5
|
-
|
6
|
-
# Raised if no or an invalid api key was passed to the api
|
7
|
-
class InvalidApiKeyException < SightstoneApiException; end
|
8
|
-
|
9
|
-
# Raised if the given developer cannot be found (api returns http error code 404)
|
10
|
-
class SummonerNotFoundException < SightstoneApiException; end
|
11
|
-
|
12
|
-
# Raised if the connection to the api failed
|
13
|
-
class SightstoneConnectionException < SightstoneApiException; end
|
14
|
-
|
15
|
-
# Raised when the RateLimit has been exceeded (api returns http error code 429)
|
16
|
-
class RateLimitExceededException < SightstoneApiException; end
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
end
|