sportradar-api 0.11.31 → 0.11.32

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: 9453492c84fe6a7f1182a94ae2764d298be9fcb1
4
- data.tar.gz: 6d895fe0e9f4cc9ba084d942076624d53edbd8e8
3
+ metadata.gz: 2cca7211cc807ff1fe6e99d4f163982e70471655
4
+ data.tar.gz: 893c057aed55e73eb55f5308bef4d05d3982f139
5
5
  SHA512:
6
- metadata.gz: b4ee75eb3625664bad50e03af5601291c041c17611757c31a31de53606ff438ea3d9958fb9ca4509bfe8ab22ad29d8d99adbc1b2544da36280acb864f08caef2
7
- data.tar.gz: 7078d4bae4c2a277ebdefc104c691d66e8f1bf79f3e60fa4721aff7f70c8d02443fc5c51cc97cce6381b3c5adfc5d0c03add9c9eea3ea186d6386dd6cce51062
6
+ metadata.gz: e8ccf0d7f9f2c90c5b344303dadc1912253fb4014a2ea70478a8f61f2632037c4c4257fc21de9e52aa62f8230c745e1dfd4e8323bdab179c28bd0beecdfb2c0a
7
+ data.tar.gz: 5ead0011e7521f0c8515305c252491340109e5a8d89f6d7653534b31f79512bf80ff5541209f8f25ff4b578f784bdb3a3d4daf6cf17f336a50605d0462873f4c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sportradar-api (0.11.31)
4
+ sportradar-api (0.11.32)
5
5
  activesupport
6
6
  httparty (>= 0.14.0)
7
7
 
@@ -29,7 +29,7 @@ module Sportradar
29
29
  end
30
30
 
31
31
  def timeouts
32
- {}
32
+ @teams_hash.map { |t_id, team| [t_id, team.timeouts] }.to_h
33
33
  end
34
34
 
35
35
  def period
@@ -25,9 +25,7 @@ module Sportradar
25
25
 
26
26
  def gain
27
27
  Array(plays.select(&:counted_play?)).sum do |play|
28
- Array(play.players).sum do |p|
29
- p.dig('passing', 'yds').to_i + p.dig('rushing', 'yds').to_i
30
- end
28
+ Array(play.statistics.pass).map(&:yards).inject(:+) + Array(play.statistics.rush).map(&:yards).inject(:+)
31
29
  end
32
30
  end
33
31
 
@@ -8,6 +8,10 @@ module Sportradar
8
8
  id
9
9
  end
10
10
 
11
+ def used_timeouts
12
+ 3 - remaining_timeouts
13
+ end
14
+
11
15
  def players
12
16
  get_roster if @players_hash.empty?
13
17
  @players_hash.values
@@ -2,7 +2,7 @@ module Sportradar
2
2
  module Api
3
3
  module Football
4
4
  class Team < Data
5
- attr_accessor :response, :id, :market, :name, :alias, :full_name, :venue, :records, :player_stats, :team_stats, :seed, :season, :type, :stats
5
+ attr_accessor :response, :id, :market, :name, :alias, :full_name, :venue, :records, :player_stats, :team_stats, :seed, :season, :type, :stats, :used_timeouts, :remaining_timeouts
6
6
 
7
7
  def initialize(data, **opts)
8
8
  @response = data
@@ -33,6 +33,8 @@ module Sportradar
33
33
  @seed = data['seed'].to_i if data['seed']
34
34
  @alias = data['alias'] if data['alias']
35
35
  @points = data['points'].to_i if data['points']
36
+ @used_timeouts = data['used_timeouts'] if data['used_timeouts']
37
+ @remaining_timeouts = data['remaining_timeouts'] if data['remaining_timeouts']
36
38
 
37
39
  parse_records(data) if data['records']
38
40
  parse_players(data.dig('players'), opts[:game]) if data.dig('players')
@@ -46,6 +48,10 @@ module Sportradar
46
48
  end
47
49
  end
48
50
  end
51
+
52
+ def timeouts
53
+ {'used' => used_timeouts, 'remaining' => remaining_timeouts}
54
+ end
49
55
  def handle_names(data)
50
56
  # need to do some more work here
51
57
  @name = data['name'] if data['name']
@@ -1,5 +1,5 @@
1
1
  module Sportradar
2
2
  module Api
3
- VERSION = "0.11.31"
3
+ VERSION = "0.11.32"
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.11.31
4
+ version: 0.11.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Eggett