infostrada 0.1.6 → 0.1.7
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/infostrada/call_refresh.rb +7 -1
- data/lib/infostrada/match.rb +1 -1
- data/lib/infostrada/match_event.rb +26 -3
- data/lib/infostrada/match_event_list.rb +1 -1
- data/lib/infostrada/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57b84b4aea8ee35eea27a04773b49ba49990cb0d
|
4
|
+
data.tar.gz: 18cf88bbe52dd649ad455f562d0271aa95c403e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39bb14fa4737dd1bd36ceac3bebfd552d7e28c126882622f2b47a39f8773b854105fc50ae2c77394ae606c0ea35f10932f66be84bda9536e450cdc97385fc3c8
|
7
|
+
data.tar.gz: 3e271439c968b7e4a7a2a72ff047135cbce57ad51494cc149a903afe6064ccea6abb2c377b5b43320f30c2f0fff78904b4f0f42ad26671dced914d1b5535e191
|
@@ -50,7 +50,7 @@ module Infostrada
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def self.get_latest
|
53
|
-
since
|
53
|
+
since api_time(Time.now-500000)
|
54
54
|
end
|
55
55
|
|
56
56
|
def self.since(date)
|
@@ -81,5 +81,11 @@ module Infostrada
|
|
81
81
|
|
82
82
|
self
|
83
83
|
end
|
84
|
+
|
85
|
+
# Helper method to return the match id from the query string.
|
86
|
+
def match_id
|
87
|
+
@query_string.match(/matchid=(\d+)/)
|
88
|
+
$1
|
89
|
+
end
|
84
90
|
end
|
85
91
|
end
|
data/lib/infostrada/match.rb
CHANGED
@@ -99,7 +99,7 @@ module Infostrada
|
|
99
99
|
|
100
100
|
def initialize(hash)
|
101
101
|
@id = hash['n_MatchID']
|
102
|
-
@date = Formatter.format_date(hash['
|
102
|
+
@date = Formatter.format_date(hash['d_DateUTC'])
|
103
103
|
@rescheduled = hash['b_RescheduledToBeResumed']
|
104
104
|
@round = hash['n_RoundNr']
|
105
105
|
@time_unknown = hash['b_TimeUnknown']
|
@@ -1,11 +1,33 @@
|
|
1
1
|
module Infostrada
|
2
|
+
# MatchEvent can have a lot of different events in a match.
|
3
|
+
#
|
4
|
+
# Here's a list of the n_ActionSet values, from Infostrada FAQ:
|
5
|
+
#
|
6
|
+
# 1 = Goals
|
7
|
+
# 2 = Penalty shootout
|
8
|
+
# 3 = Cards
|
9
|
+
# 4 = Line-up
|
10
|
+
# 5 = Substitutions
|
11
|
+
# 6 = Substitutes not used
|
12
|
+
# 7 = Players not selected / suspended
|
13
|
+
# 8 = Coaches
|
14
|
+
# 9 = Officials
|
15
|
+
# 10 = Missed penalties
|
16
|
+
# 11 = Captain
|
17
|
+
# 12 = Free kick / Foul / Corner / Offside / Shot / Save
|
18
|
+
# 13 = Possession
|
19
|
+
# 14 = Temporarily out
|
20
|
+
# 15 = Other
|
21
|
+
# 16 = Time
|
2
22
|
class MatchEvent
|
3
23
|
attr_accessor :id, :description, :short_description, :period, :period_short, :time, :home_goals
|
4
24
|
attr_accessor :away_goals, :home_event, :team_id, :team_name, :team_short_name, :person_id
|
5
25
|
attr_accessor :person_name, :person_short_name, :reason, :info, :person2_id, :person2_name
|
6
|
-
attr_accessor :person2_short_name, :minute
|
26
|
+
attr_accessor :person2_short_name, :minute, :match_id, :action_set
|
27
|
+
|
28
|
+
def initialize(match_id, hash)
|
29
|
+
@match_id = match_id
|
7
30
|
|
8
|
-
def initialize(hash)
|
9
31
|
@id = hash['n_ActionID']
|
10
32
|
@description = hash['c_Action']
|
11
33
|
@short_description = hash['c_ActionShort']
|
@@ -14,7 +36,7 @@ module Infostrada
|
|
14
36
|
@time = hash['n_ActionTime']
|
15
37
|
@home_goals = hash['n_HomeGoals']
|
16
38
|
@away_goals = hash['n_AwayGoals']
|
17
|
-
@home_event =
|
39
|
+
@home_event = hash['n_HomeOrAway'] == 1 ? true : false
|
18
40
|
@team_id = hash['n_TeamID']
|
19
41
|
@team_name = hash['c_Team']
|
20
42
|
@team_short_name = hash['c_TeamShort']
|
@@ -27,6 +49,7 @@ module Infostrada
|
|
27
49
|
@person2_name = hash['c_SubPerson']
|
28
50
|
@person2_short_name = hash['c_SubPersonShort']
|
29
51
|
@minute = hash['c_ActionMinute']
|
52
|
+
@action_set = hash['n_ActionSet']
|
30
53
|
|
31
54
|
self
|
32
55
|
end
|
data/lib/infostrada/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: infostrada
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ricardo Otero
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|