sportradar-api 0.1.24 → 0.1.25
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/Gemfile.lock +1 -1
- data/lib/sportradar/api/nfl.rb +3 -2
- data/lib/sportradar/api/nfl/season.rb +12 -1
- data/lib/sportradar/api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ab8909c00d8d501e955fa4177760b6fca26364e6
|
|
4
|
+
data.tar.gz: 25a0737f80a930197e26831d251b99046b9b9591
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: baa0a432521806957749cc7d304f43c65b459cc4a51607aa6c018a32b5b0f02c3812a98361617f531296a75e450c117a58303c766171113c3f306008c1e29c6f
|
|
7
|
+
data.tar.gz: c895e2cabe8def8896b0d56a99734228dc81d8dcb800562e9a23a7d290256c2e7155642b82084887fbd341fbd6fcbc3309cbfd069dad19719b4f2a79035bc4d1
|
data/Gemfile.lock
CHANGED
data/lib/sportradar/api/nfl.rb
CHANGED
|
@@ -79,8 +79,9 @@ module Sportradar
|
|
|
79
79
|
end
|
|
80
80
|
|
|
81
81
|
def standings(year = Date.today.year)
|
|
82
|
-
get request_url("seasontd/#{ year }/standings")
|
|
83
|
-
|
|
82
|
+
response = get request_url("seasontd/#{ year }/standings")
|
|
83
|
+
Sportradar::Api::Nfl::Season.new response["season"] if response.success? && response["season"]
|
|
84
|
+
# TODO Needs implement rankings/records/stats on team
|
|
84
85
|
end
|
|
85
86
|
|
|
86
87
|
def daily_change_log(date = Date.today)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Sportradar
|
|
2
2
|
module Api
|
|
3
3
|
class Nfl::Season < Data
|
|
4
|
-
attr_accessor :response, :id, :year, :type, :name, :weeks, :injuries, :team
|
|
4
|
+
attr_accessor :response, :id, :year, :type, :name, :weeks, :injuries, :team, :conferences
|
|
5
5
|
|
|
6
6
|
def initialize(data)
|
|
7
7
|
@response = data
|
|
@@ -12,6 +12,7 @@ module Sportradar
|
|
|
12
12
|
@team = Sportradar::Api::Nfl::Team.new(data["team"]) if data["team"].is_a?(Hash)
|
|
13
13
|
@injuries = data["injuries"]["team"].map {|team| Sportradar::Api::Nfl::Team.new team } if data["injuries"] && data["injuries"]["team"]
|
|
14
14
|
set_weeks
|
|
15
|
+
set_conferences
|
|
15
16
|
end
|
|
16
17
|
|
|
17
18
|
private
|
|
@@ -26,6 +27,16 @@ module Sportradar
|
|
|
26
27
|
end
|
|
27
28
|
end
|
|
28
29
|
|
|
30
|
+
def set_conferences
|
|
31
|
+
if response["conference"]
|
|
32
|
+
if response["conference"].is_a?(Array)
|
|
33
|
+
@conferences = response["conference"].map {|conference| Sportradar::Api::Nfl::Conference.new conference }
|
|
34
|
+
elsif response["conference"].is_a?(Hash)
|
|
35
|
+
@conferences = [ Sportradar::Api::Nfl::Conference.new(response["conference"]) ]
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
29
40
|
end
|
|
30
41
|
end
|
|
31
42
|
end
|