Class: EspnScrape
Overview
EspnScrape main class
Constant Summary
Constants included from Version
Instance Method Summary collapse
-
#getBoxscore(game_id = 0) ⇒ NbaBoxScore
get/set method for boxscore.
-
#getRoster(team_id = '') ⇒ NbaRoster
get/set method for roster.
-
#getSchedule(team_id = '') ⇒ NbaSchedule
get/set method for schedule.
-
#getTeamList ⇒ NbaTeamList
Return list of NBA teams.
-
#initialize ⇒ EspnScrape
constructor
Create EspnScrape object.
Constructor Details
#initialize ⇒ EspnScrape
Create EspnScrape object
27 28 29 30 31 32 |
# File 'lib/espnscrape.rb', line 27 def initialize @boxscore = getBoxscore() @roster = getRoster() @team_list = getTeamList() # @schedule = getSchedule() end |
Instance Method Details
#getBoxscore(game_id = 0) ⇒ NbaBoxScore
get/set method for boxscore
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/espnscrape.rb', line 40 def getBoxscore(game_id=0) if game_id == 0 && !@boxscore.nil? return @boxscore elsif game_id != 0 @boxscore = NbaBoxScore.new(game_id) return @boxscore else return nil end end |
#getRoster(team_id = '') ⇒ NbaRoster
get/set method for roster
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/espnscrape.rb', line 58 def getRoster(team_id='') if team_id == '' && !@roster.nil? return @roster elsif team_id != '' @roster = NbaRoster.new(team_id) return @roster else return nil end end |
#getSchedule(team_id = '') ⇒ NbaSchedule
get/set method for schedule
85 86 87 88 89 90 91 92 93 94 |
# File 'lib/espnscrape.rb', line 85 def getSchedule(team_id='') if team_id == '' && !@schedule.nil? return @schedule elsif team_id != '' @schedule = NbaSchedule.new(team_id) return @schedule else return nil end end |
#getTeamList ⇒ NbaTeamList
Return list of NBA teams
71 72 73 74 75 76 |
# File 'lib/espnscrape.rb', line 71 def getTeamList() if @team_list.nil? @team_list = NbaTeamList.new() end return @team_list end |