Class: ScheduleGame

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_numberObject

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_leagueObject

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_abbrevObject

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

#dateObject

Returns the value of attribute date.



7
8
9
# File 'lib/schedule_game.rb', line 7

def date
  @date
end

#day_of_weekObject

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_nightObject

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_numberObject

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_leagueObject

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_abbrevObject

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