Class: SportsDataApi::Ncaafb::Game
- Inherits:
-
Object
- Object
- SportsDataApi::Ncaafb::Game
- Defined in:
- lib/sports_data_api/ncaafb/game.rb
Instance Attribute Summary collapse
-
#away ⇒ Object
readonly
Returns the value of attribute away.
-
#away_team ⇒ Object
readonly
Returns the value of attribute away_team.
-
#away_team_id ⇒ Object
readonly
Returns the value of attribute away_team_id.
-
#broadcast ⇒ Object
readonly
Returns the value of attribute broadcast.
-
#clock ⇒ Object
readonly
Returns the value of attribute clock.
-
#home ⇒ Object
readonly
Returns the value of attribute home.
-
#home_team ⇒ Object
readonly
Returns the value of attribute home_team.
-
#home_team_id ⇒ Object
readonly
Returns the value of attribute home_team_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#quarter ⇒ Object
readonly
Returns the value of attribute quarter.
-
#scheduled ⇒ Object
readonly
Returns the value of attribute scheduled.
-
#season ⇒ Object
readonly
Returns the value of attribute season.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#venue ⇒ Object
readonly
Returns the value of attribute venue.
-
#weather ⇒ Object
readonly
Returns the value of attribute weather.
-
#week ⇒ Object
readonly
Returns the value of attribute week.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
-
#boxscore ⇒ Object
Wrapper for Ncaafb.boxscore these helper methods are used to provide similar functionality as the links attribute found in the weekly schedule example.
-
#depthchart ⇒ Object
Wrapper for Ncaafb.depthchart TODO.
-
#initialize(year, season, week, game_hash) ⇒ Game
constructor
A new instance of Game.
-
#injuries ⇒ Object
Wrapper for Ncaafb.injuries TODO.
-
#pbp ⇒ Object
Wrapper for Ncaafb.pbp (Ncaafb.play_by_play) TODO.
-
#roster ⇒ Object
Wrapper for Ncaafb.game_roster TODO.
-
#statistics ⇒ Object
Wrapper for Ncaafb.statistics.
-
#summary ⇒ Object
Wrapper for Ncaafb.summary TODO.
Constructor Details
#initialize(year, season, week, game_hash) ⇒ Game
Returns a new instance of Game.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 8 def initialize(year, season, week, game_hash) @year = year @season = season @week = week @id = game_hash['id'] @scheduled = Time.parse game_hash['scheduled'] @home = game_hash['home'] || game_hash['home_team']['id'] @away = game_hash['away'] || game_hash['away_team']['id'] @home_team_id = @home @away_team_id = @away @status = game_hash['status'] @quarter = game_hash['quarter'].to_i @clock = game_hash['clock'] @home_team = Team.new(game_hash['home_team']) @away_team = Team.new(game_hash['away_team']) @venue = Venue.new(game_hash['venue']) @broadcast = Broadcast.new(game_hash['broadcast']) @weather = Weather.new(game_hash['weather']) end |
Instance Attribute Details
#away ⇒ Object (readonly)
Returns the value of attribute away.
4 5 6 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 4 def away @away end |
#away_team ⇒ Object (readonly)
Returns the value of attribute away_team.
4 5 6 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 4 def away_team @away_team end |
#away_team_id ⇒ Object (readonly)
Returns the value of attribute away_team_id.
4 5 6 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 4 def away_team_id @away_team_id end |
#broadcast ⇒ Object (readonly)
Returns the value of attribute broadcast.
4 5 6 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 4 def broadcast @broadcast end |
#clock ⇒ Object (readonly)
Returns the value of attribute clock.
4 5 6 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 4 def clock @clock end |
#home ⇒ Object (readonly)
Returns the value of attribute home.
4 5 6 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 4 def home @home end |
#home_team ⇒ Object (readonly)
Returns the value of attribute home_team.
4 5 6 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 4 def home_team @home_team end |
#home_team_id ⇒ Object (readonly)
Returns the value of attribute home_team_id.
4 5 6 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 4 def home_team_id @home_team_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 4 def id @id end |
#quarter ⇒ Object (readonly)
Returns the value of attribute quarter.
4 5 6 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 4 def quarter @quarter end |
#scheduled ⇒ Object (readonly)
Returns the value of attribute scheduled.
4 5 6 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 4 def scheduled @scheduled end |
#season ⇒ Object (readonly)
Returns the value of attribute season.
4 5 6 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 4 def season @season end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 4 def status @status end |
#venue ⇒ Object (readonly)
Returns the value of attribute venue.
4 5 6 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 4 def venue @venue end |
#weather ⇒ Object (readonly)
Returns the value of attribute weather.
4 5 6 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 4 def weather @weather end |
#week ⇒ Object (readonly)
Returns the value of attribute week.
4 5 6 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 4 def week @week end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
4 5 6 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 4 def year @year end |
Instance Method Details
#boxscore ⇒ Object
Wrapper for Ncaafb.boxscore these helper methods are used to provide similar functionality as the links attribute found in the weekly schedule example.
54 55 56 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 54 def boxscore Ncaafb.boxscore(year, season, week, home, away) end |
#depthchart ⇒ Object
Wrapper for Ncaafb.depthchart TODO
75 76 77 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 75 def depthchart raise NotImplementedError end |
#injuries ⇒ Object
Wrapper for Ncaafb.injuries TODO
68 69 70 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 68 def injuries raise NotImplementedError end |
#pbp ⇒ Object
Wrapper for Ncaafb.pbp (Ncaafb.play_by_play) TODO
46 47 48 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 46 def pbp raise NotImplementedError end |
#roster ⇒ Object
Wrapper for Ncaafb.game_roster TODO
61 62 63 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 61 def roster Ncaafb.game_roster(year, season, week, home, away) end |
#statistics ⇒ Object
Wrapper for Ncaafb.statistics
32 33 34 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 32 def statistics Ncaafb.game_statistics(year, season, week, home, away) end |
#summary ⇒ Object
Wrapper for Ncaafb.summary TODO
39 40 41 |
# File 'lib/sports_data_api/ncaafb/game.rb', line 39 def summary raise NotImplementedError end |