sportradar-api 0.1.24 → 0.1.25

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 599fc7a3f7be2e1d142303d971e0634f31cf34da
4
- data.tar.gz: 2e11746f6b9001547734e9fe56fc5cbbcd10fe4e
3
+ metadata.gz: ab8909c00d8d501e955fa4177760b6fca26364e6
4
+ data.tar.gz: 25a0737f80a930197e26831d251b99046b9b9591
5
5
  SHA512:
6
- metadata.gz: 12ebadc69028ca8914e6e57ea79cd3ba68152afe4d61b16c095e9624b2469e5f41977320253088e5f52a8e5ed942c4789242a94d2615022923920c22048c7589
7
- data.tar.gz: b725857de0542583122d58bdf8ed2967c5201c62034a22a3dd142df0c7d33dc39dec0504a62db99686524b1b9351b8323fee5ca62b93ae7c55fb9b133a24c1fd
6
+ metadata.gz: baa0a432521806957749cc7d304f43c65b459cc4a51607aa6c018a32b5b0f02c3812a98361617f531296a75e450c117a58303c766171113c3f306008c1e29c6f
7
+ data.tar.gz: c895e2cabe8def8896b0d56a99734228dc81d8dcb800562e9a23a7d290256c2e7155642b82084887fbd341fbd6fcbc3309cbfd069dad19719b4f2a79035bc4d1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sportradar-api (0.1.24)
4
+ sportradar-api (0.1.25)
5
5
  activesupport
6
6
  httparty (>= 0.13.3)
7
7
 
@@ -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
- # TODO Needs implemented with more attention
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
@@ -1,5 +1,5 @@
1
1
  module Sportradar
2
2
  module Api
3
- VERSION = "0.1.24"
3
+ VERSION = "0.1.25"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sportradar-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.24
4
+ version: 0.1.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Eggett