Class: Sportradar::Api::Football::Ncaafb::Team

Inherits:
Team
  • Object
show all
Defined in:
lib/sportradar/api/football/ncaafb/team.rb

Instance Attribute Summary

Attributes inherited from Team

#full_name, #id, #market, #name, #player_stats, #records, #remaining_timeouts, #response, #season, #seed, #stats, #team_stats, #type, #venue

Instance Method Summary collapse

Methods inherited from Team

#add_game, #games, #get_roster, #get_season_stats, #handle_names, #ingest_roster, #ingest_season_stats, #initialize, #parse_players, #parse_season_stats, #path_base, #path_base_stats, #queue_roster, #queue_season_stats, #record, #season_year, #timeouts, #update, #update_player_stats

Methods inherited from Data

#all_attributes, #attributes, #create_data, #parse_into_array, #parse_into_array_with_options, #parse_out_hashes, #structure_links, #update_data

Constructor Details

This class inherits a constructor from Sportradar::Api::Football::Team

Instance Method Details

#aliasObject



7
8
9
# File 'lib/sportradar/api/football/ncaafb/team.rb', line 7

def alias
  id
end

#apiObject



37
38
39
# File 'lib/sportradar/api/football/ncaafb/team.rb', line 37

def api
  @api || Sportradar::Api::Football::Ncaafb::Api.new
end

#ncaafb_seasonObject



40
41
42
# File 'lib/sportradar/api/football/ncaafb/team.rb', line 40

def ncaafb_season
  @type || default_season
end

#parse_records(data) ⇒ Object



15
16
17
18
# File 'lib/sportradar/api/football/ncaafb/team.rb', line 15

def parse_records(data)
  @records['overall'] = Record.new(data['overall'], type: 'overall')
  # data['records'].each { |record| @records[record['record_type']] = Record.new(record, type: record['record_type']) }
end

#path_rosterObject



30
31
32
# File 'lib/sportradar/api/football/ncaafb/team.rb', line 30

def path_roster
  "#{ path_base }/roster"
end

#path_season_stats(year = season_year, season = ncaafb_season) ⇒ Object



33
34
35
# File 'lib/sportradar/api/football/ncaafb/team.rb', line 33

def path_season_stats(year = season_year, season = ncaafb_season)
  "#{path_base}/#{year}/#{ncaafb_season}/statistics"
end

#player_classObject



26
27
28
# File 'lib/sportradar/api/football/ncaafb/team.rb', line 26

def player_class
  Player
end

#playersObject Also known as: roster



20
21
22
23
# File 'lib/sportradar/api/football/ncaafb/team.rb', line 20

def players
  get_roster if @players_hash.empty?
  @players_hash.values
end

#used_timeoutsObject



11
12
13
# File 'lib/sportradar/api/football/ncaafb/team.rb', line 11

def used_timeouts
  3 - remaining_timeouts.to_i
end