lib/sportradar/api/football/team.rb in sportradar-api-0.11.31 vs lib/sportradar/api/football/team.rb in sportradar-api-0.11.32
- old
+ new
@@ -1,10 +1,10 @@
module Sportradar
module Api
module Football
class Team < Data
- attr_accessor :response, :id, :market, :name, :alias, :full_name, :venue, :records, :player_stats, :team_stats, :seed, :season, :type, :stats
+ attr_accessor :response, :id, :market, :name, :alias, :full_name, :venue, :records, :player_stats, :team_stats, :seed, :season, :type, :stats, :used_timeouts, :remaining_timeouts
def initialize(data, **opts)
@response = data
@api = opts[:api]
@@ -31,10 +31,12 @@
@venue = Venue.new(data['venue']) if data['venue']
@seed = data['seed'].to_i if data['seed']
@alias = data['alias'] if data['alias']
@points = data['points'].to_i if data['points']
+ @used_timeouts = data['used_timeouts'] if data['used_timeouts']
+ @remaining_timeouts = data['remaining_timeouts'] if data['remaining_timeouts']
parse_records(data) if data['records']
parse_players(data.dig('players'), opts[:game]) if data.dig('players')
# parse_stats(data['statistics']) if data['statistics']
if opts[:game]
@@ -43,9 +45,13 @@
if data['statistics']
@stats = Sportradar::Api::Football::GameStats.new(data['statistics'])
opts[:game].update_stats(self, @stats)
end
end
+ end
+
+ def timeouts
+ {'used' => used_timeouts, 'remaining' => remaining_timeouts}
end
def handle_names(data)
# need to do some more work here
@name = data['name'] if data['name']
if data['name'] && !data.key?('market')