Class: GamedayPathBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/gameday_path_builder.rb

Constant Summary collapse

FILE_BASE_PATH =
'components/game/mlb'

Class Method Summary collapse

Class Method Details

.build_batter_path(year, month, day, gid, pid) ⇒ Object



79
80
81
82
# File 'lib/gameday_path_builder.rb', line 79

def self.build_batter_path(year, month, day, gid, pid)
  set_date_vars(year, month, day)
  "#{FILE_BASE_PATH}/" + year_month_day_path + "/gid_"+gid+"/batters/" +  pid + '.xml'
end

.build_boxscore_path(year, month, day, gid) ⇒ Object



43
44
45
46
# File 'lib/gameday_path_builder.rb', line 43

def self.build_boxscore_path(year, month, day, gid)
  set_date_vars(year, month, day)
  "#{FILE_BASE_PATH}/" + year_month_day_path + "/gid_"+gid+"/boxscore.xml" 
end

.build_day_highlights_path(year, month, day) ⇒ Object



37
38
39
40
# File 'lib/gameday_path_builder.rb', line 37

def self.build_day_highlights_path(year, month, day)
  set_date_vars(year, month, day)
  "#{FILE_BASE_PATH}/" + year_month_day_path + "/media/highlights.xml"
end

.build_day_path(year, month, day) ⇒ Object



109
110
111
112
# File 'lib/gameday_path_builder.rb', line 109

def self.build_day_path(year, month, day)
  set_date_vars(year, month, day)
  "#{FILE_BASE_PATH}/year_#{@@year}/month_#{@@month}/day_#{@@day}/"
end

.build_epg_path(year, month, day) ⇒ Object



25
26
27
28
# File 'lib/gameday_path_builder.rb', line 25

def self.build_epg_path(year, month, day)
  set_date_vars(year, month, day)
  "#{FILE_BASE_PATH}/" + year_month_day_path + "/epg.xml"
end

.build_eventlog_path(year, month, day, gid) ⇒ Object



19
20
21
22
# File 'lib/gameday_path_builder.rb', line 19

def self.build_eventlog_path(year, month, day, gid)
  set_date_vars(year, month, day)
  "#{FILE_BASE_PATH}/" + year_month_day_path + "/gid_"+gid+"/eventLog.xml" 
end

.build_game_base_path(gid) ⇒ Object



13
14
15
16
# File 'lib/gameday_path_builder.rb', line 13

def self.build_game_base_path(gid)
  gameday_info = GamedayUtil.parse_gameday_id('gid_' + gid)
  "#{FILE_BASE_PATH}/year_" + gameday_info['year'] + "/month_" + gameday_info['month'] + "/day_" + gameday_info['day'] + "/gid_"+gid 
end

.build_game_events_path(year, month, day, gid) ⇒ Object



55
56
57
58
# File 'lib/gameday_path_builder.rb', line 55

def self.build_game_events_path(year, month, day, gid)
  set_date_vars(year, month, day)
  "#{FILE_BASE_PATH}/" + year_month_day_path + "/gid_"+gid+"/game_events.xml" 
end

.build_game_path(year, month, day, gid) ⇒ Object



49
50
51
52
# File 'lib/gameday_path_builder.rb', line 49

def self.build_game_path(year, month, day, gid)
  set_date_vars(year, month, day)
  "#{FILE_BASE_PATH}/" + year_month_day_path + "/gid_"+gid+"/game.xml" 
end

.build_gamecenter_path(year, month, day, gid) ⇒ Object



61
62
63
64
# File 'lib/gameday_path_builder.rb', line 61

def self.build_gamecenter_path(year, month, day, gid)
  set_date_vars(year, month, day)
  "#{FILE_BASE_PATH}/" + year_month_day_path + "/gid_"+gid+"/gamecenter.xml" 
end

.build_inning_hit_path(year, month, day, gid) ⇒ Object



103
104
105
106
# File 'lib/gameday_path_builder.rb', line 103

def self.build_inning_hit_path(year, month, day, gid)
  set_date_vars(year, month, day)
  "#{FILE_BASE_PATH}/" + year_month_day_path + "/gid_"+gid+"/inning/inning_hit.xml"
end

.build_inning_scores_path(year, month, day, gid) ⇒ Object



97
98
99
100
# File 'lib/gameday_path_builder.rb', line 97

def self.build_inning_scores_path(year, month, day, gid)
  set_date_vars(year, month, day)
  "#{FILE_BASE_PATH}/" + year_month_day_path + "/gid_"+gid+"/inning/inning_Scores.xml"
end

.build_inningx_path(year, month, day, gid, inning_num) ⇒ Object



91
92
93
94
# File 'lib/gameday_path_builder.rb', line 91

def self.build_inningx_path(year, month, day, gid, inning_num)
  set_date_vars(year, month, day)
  "#{FILE_BASE_PATH}/" + year_month_day_path + "/gid_"+gid+"/inning/inning_#{inning_num}.xml"
end

.build_linescore_path(year, month, day, gid) ⇒ Object



67
68
69
70
# File 'lib/gameday_path_builder.rb', line 67

def self.build_linescore_path(year, month, day, gid)
  set_date_vars(year, month, day)
  "#{FILE_BASE_PATH}/" + year_month_day_path + "/gid_"+gid+"/linescore.xml" 
end

.build_month_path(year, month) ⇒ Object



115
116
117
118
# File 'lib/gameday_path_builder.rb', line 115

def self.build_month_path(year, month)
  set_date_vars(year, month, nil)
  "#{FILE_BASE_PATH}/year_#{@@year}/month_#{@@month}/"
end

.build_pitcher_path(year, month, day, gid, pid) ⇒ Object



85
86
87
88
# File 'lib/gameday_path_builder.rb', line 85

def self.build_pitcher_path(year, month, day, gid, pid)
  set_date_vars(year, month, day)
  "#{FILE_BASE_PATH}/" + year_month_day_path + "/gid_"+gid+"/pitchers/" +  pid + '.xml' 
end

.build_players_path(year, month, day, gid) ⇒ Object



73
74
75
76
# File 'lib/gameday_path_builder.rb', line 73

def self.build_players_path(year, month, day, gid)
  set_date_vars(year, month, day)
  "#{FILE_BASE_PATH}/" + year_month_day_path + "/gid_"+gid+"/players.xml" 
end

.build_scoreboard_path(year, month, day) ⇒ Object



31
32
33
34
# File 'lib/gameday_path_builder.rb', line 31

def self.build_scoreboard_path(year, month, day)
  set_date_vars(year, month, day)
  "#{FILE_BASE_PATH}/" + year_month_day_path + "/master_scoreboard.xml"
end

.year_month_day_pathObject



8
9
10
# File 'lib/gameday_path_builder.rb', line 8

def self.year_month_day_path
  "year_" + @@year + "/month_" + @@month + "/day_" + @@day
end