Class: ScheduleGame
- Inherits:
-
Object
- Object
- ScheduleGame
- Defined in:
- lib/schedule_game.rb
Overview
This class represents a single game from a game schedule This class is used in conjunction with the Schedule class. This is not the class you would use to retrieve game statistics.
Instance Attribute Summary collapse
-
#away_game_number ⇒ Object
Returns the value of attribute away_game_number.
-
#away_league ⇒ Object
Returns the value of attribute away_league.
-
#away_team_abbrev ⇒ Object
Returns the value of attribute away_team_abbrev.
-
#date ⇒ Object
Returns the value of attribute date.
-
#day_of_week ⇒ Object
Returns the value of attribute day_of_week.
-
#day_or_night ⇒ Object
Returns the value of attribute day_or_night.
-
#home_game_number ⇒ Object
Returns the value of attribute home_game_number.
-
#home_league ⇒ Object
Returns the value of attribute home_league.
-
#home_team_abbrev ⇒ Object
Returns the value of attribute home_team_abbrev.
Instance Method Summary collapse
-
#initialize(line) ⇒ ScheduleGame
constructor
A new instance of ScheduleGame.
Constructor Details
#initialize(line) ⇒ ScheduleGame
Returns a new instance of ScheduleGame.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/schedule_game.rb', line 11 def initialize(line) temp = line.split(',') @date = temp[0].tr_s('"', '').strip @day_of_week = temp[2].tr_s('"', '').strip @away_team_abbrev = temp[3].tr_s('"', '').strip @away_league = temp[4].tr_s('"', '').strip @away_game_number = temp[5].tr_s('"', '').strip @home_team_abbrev = temp[6].tr_s('"', '').strip @home_league = temp[7].tr_s('"', '').strip @home_game_number = temp[8].tr_s('"', '').strip @day_or_night = temp[9].tr_s('"', '').strip end |
Instance Attribute Details
#away_game_number ⇒ Object
Returns the value of attribute away_game_number.
7 8 9 |
# File 'lib/schedule_game.rb', line 7 def away_game_number @away_game_number end |
#away_league ⇒ Object
Returns the value of attribute away_league.
7 8 9 |
# File 'lib/schedule_game.rb', line 7 def away_league @away_league end |
#away_team_abbrev ⇒ Object
Returns the value of attribute away_team_abbrev.
7 8 9 |
# File 'lib/schedule_game.rb', line 7 def away_team_abbrev @away_team_abbrev end |
#date ⇒ Object
Returns the value of attribute date.
7 8 9 |
# File 'lib/schedule_game.rb', line 7 def date @date end |
#day_of_week ⇒ Object
Returns the value of attribute day_of_week.
7 8 9 |
# File 'lib/schedule_game.rb', line 7 def day_of_week @day_of_week end |
#day_or_night ⇒ Object
Returns the value of attribute day_or_night.
8 9 10 |
# File 'lib/schedule_game.rb', line 8 def day_or_night @day_or_night end |
#home_game_number ⇒ Object
Returns the value of attribute home_game_number.
8 9 10 |
# File 'lib/schedule_game.rb', line 8 def home_game_number @home_game_number end |
#home_league ⇒ Object
Returns the value of attribute home_league.
8 9 10 |
# File 'lib/schedule_game.rb', line 8 def home_league @home_league end |
#home_team_abbrev ⇒ Object
Returns the value of attribute home_team_abbrev.
8 9 10 |
# File 'lib/schedule_game.rb', line 8 def home_team_abbrev @home_team_abbrev end |