sportradar-api 0.1.35 → 0.1.36
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ca09d1345e62f293f9d60bdd94130b228d75eb74
|
|
4
|
+
data.tar.gz: e956f6aabd92db91b1d76fc416d98e08b4c99e9b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 20da3ed3414475195779ffe7833181c2a98a7cd3d363bdec0174f861fc99c146438067431d80669fb0c038e98d7577d556f2ed8e13cd2115391d9bb3def76e86
|
|
7
|
+
data.tar.gz: 6b233f24099da61879525aaa37e5f2b8223e4b5650ac3c9a2faf1748c56190a4df74a8a908923f02e6e1c8d09188fbb1a432984762c1d54a8c5212e403f35e3e
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
module Sportradar
|
|
2
2
|
module Api
|
|
3
3
|
class Nfl::DepthChart < Data
|
|
4
|
+
include Enumerable
|
|
4
5
|
attr_accessor :response, :chart
|
|
5
6
|
|
|
6
7
|
def initialize(data)
|
|
@@ -10,6 +11,10 @@ module Sportradar
|
|
|
10
11
|
def team(number)
|
|
11
12
|
teams[number]
|
|
12
13
|
end
|
|
14
|
+
def each
|
|
15
|
+
populate_teams
|
|
16
|
+
teams.each { |team| yield team }
|
|
17
|
+
end
|
|
13
18
|
|
|
14
19
|
private
|
|
15
20
|
|
|
@@ -17,6 +22,10 @@ module Sportradar
|
|
|
17
22
|
@teams ||= Hash.new { |hash, number| hash[number] = generate_team(number) }
|
|
18
23
|
end
|
|
19
24
|
|
|
25
|
+
def populate_teams
|
|
26
|
+
(1..3).each(&method(:team)) if teams.empty?
|
|
27
|
+
end
|
|
28
|
+
|
|
20
29
|
def generate_team(number)
|
|
21
30
|
@chart.each_with_object({}) do |(pos_name, groups), memo|
|
|
22
31
|
memo[pos_name] = groups[number.to_s]
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
module Sportradar
|
|
2
2
|
module Api
|
|
3
3
|
class Nfl::LeagueDepthChart < Data
|
|
4
|
+
include Enumerable
|
|
4
5
|
attr_accessor :response, :season, :charts
|
|
5
6
|
|
|
6
7
|
def initialize(data)
|
|
@@ -19,6 +20,10 @@ module Sportradar
|
|
|
19
20
|
@charts.detect { |chart| chart.team_id == id || chart.abbrev == abbrev }
|
|
20
21
|
end
|
|
21
22
|
|
|
23
|
+
def each
|
|
24
|
+
self.charts.each { |chart| yield chart }
|
|
25
|
+
end
|
|
26
|
+
|
|
22
27
|
end
|
|
23
28
|
end
|
|
24
29
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Sportradar
|
|
2
2
|
module Api
|
|
3
3
|
class Nfl::Team < Data
|
|
4
|
-
attr_accessor :response, :id, :name, :alias, :game_number, :defense, :special_teams, :offense, :players, :statistics, :team_records, :player_records, :market, :franchise, :venue, :hierarchy, :coaches, :players, :used_timeouts, :remaining_timeouts, :points, :wins, :losses, :ties, :win_pct, :rank, :stats
|
|
4
|
+
attr_accessor :response, :id, :name, :alias, :game_number, :defense, :special_teams, :offense, :players, :statistics, :team_records, :player_records, :market, :franchise, :venue, :hierarchy, :coaches, :players, :used_timeouts, :remaining_timeouts, :points, :wins, :losses, :ties, :win_pct, :rank, :stats, :depth_chart
|
|
5
5
|
|
|
6
6
|
alias_method :score, :points
|
|
7
7
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
module Sportradar
|
|
2
2
|
module Api
|
|
3
3
|
class Nfl::TeamDepthChart < Data
|
|
4
|
+
include Enumerable
|
|
4
5
|
attr_accessor :response, :season, :team_id, :abbrev
|
|
5
6
|
|
|
6
7
|
# data.keys => ["offense", "defense", "special_teams", "name", "market", "alias", "id"]
|
|
@@ -27,6 +28,10 @@ module Sportradar
|
|
|
27
28
|
@team ||= Sportradar::Api::Nfl::Team.new(response).tap { |team| team.depth_chart = self }
|
|
28
29
|
end
|
|
29
30
|
|
|
31
|
+
def each
|
|
32
|
+
[:offense, :defense, :special_teams].each { |type| yield type, send(type) }
|
|
33
|
+
end
|
|
34
|
+
|
|
30
35
|
private
|
|
31
36
|
|
|
32
37
|
def set_charts
|