Class: GamedayUrlBuilder

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

Class Method Summary collapse

Class Method Details

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



72
73
74
75
# File 'lib/gameday_url_builder.rb', line 72

def self.build_batter_url(year, month, day, gid, pid)
  set_date_vars(year, month, day)
  "#{Gameday::GD2_MLB_BASE}/mlb/year_" + @@year + "/month_" + @@month + "/day_" + @@day + "/gid_"+gid+"/batters/" +  pid + '.xml'
end

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



36
37
38
39
# File 'lib/gameday_url_builder.rb', line 36

def self.build_boxscore_url(year, month, day, gid)
  set_date_vars(year, month, day)
  "#{Gameday::GD2_MLB_BASE}/mlb/year_" + @@year + "/month_" + @@month + "/day_" + @@day + "/gid_"+gid+"/boxscore.xml" 
end

.build_day_highlights_url(year, month, day) ⇒ Object



30
31
32
33
# File 'lib/gameday_url_builder.rb', line 30

def self.build_day_highlights_url(year, month, day)
  set_date_vars(year, month, day)
  "#{Gameday::GD2_MLB_BASE}/mlb/year_" + @@year + "/month_" + @@month + "/day_" + @@day + "/media/highlights.xml"
end

.build_day_url(year, month, day) ⇒ Object



102
103
104
105
# File 'lib/gameday_url_builder.rb', line 102

def self.build_day_url(year, month, day)
  set_date_vars(year, month, day)
  "#{Gameday::GD2_MLB_BASE}/mlb/year_#{@@year}/month_#{@@month}/day_#{@@day}/"
end

.build_epg_url(year, month, day) ⇒ Object



18
19
20
21
# File 'lib/gameday_url_builder.rb', line 18

def self.build_epg_url(year, month, day)
  set_date_vars(year, month, day)
  "#{Gameday::GD2_MLB_BASE}/mlb/year_" + @@year + "/month_" + @@month + "/day_" + @@day + "/epg.xml"
end

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



12
13
14
15
# File 'lib/gameday_url_builder.rb', line 12

def self.build_eventlog_url(year, month, day, gid)
  set_date_vars(year, month, day)
  "#{Gameday::GD2_MLB_BASE}/mlb/year_" + @@year + "/month_" + @@month + "/day_" + @@day + "/gid_"+gid+"/eventLog.xml" 
end

.build_game_base_url(gid) ⇒ Object



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

def self.build_game_base_url(gid)
  gameday_info = GamedayUtil.parse_gameday_id('gid_' + gid)
  "#{Gameday::GD2_MLB_BASE}/mlb/year_" + gameday_info['year'] + "/month_" + gameday_info['month'] + "/day_" + gameday_info['day'] + "/gid_"+gid 
end

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



48
49
50
51
# File 'lib/gameday_url_builder.rb', line 48

def self.build_game_events_url(year, month, day, gid)
  set_date_vars(year, month, day)
  "#{Gameday::GD2_MLB_BASE}/mlb/year_" + @@year + "/month_" + @@month + "/day_" + @@day + "/gid_"+gid+"/game_events.xml" 
end

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



42
43
44
45
# File 'lib/gameday_url_builder.rb', line 42

def self.build_game_url(year, month, day, gid)
  set_date_vars(year, month, day)
  "#{Gameday::GD2_MLB_BASE}/mlb/year_" + @@year + "/month_" + @@month + "/day_" + @@day + "/gid_"+gid+"/game.xml" 
end

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



54
55
56
57
# File 'lib/gameday_url_builder.rb', line 54

def self.build_gamecenter_url(year, month, day, gid)
  set_date_vars(year, month, day)
  "#{Gameday::GD2_MLB_BASE}/mlb/year_" + @@year + "/month_" + @@month + "/day_" + @@day + "/gid_"+gid+"/gamecenter.xml" 
end

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



96
97
98
99
# File 'lib/gameday_url_builder.rb', line 96

def self.build_inning_hit_url(year, month, day, gid)
  set_date_vars(year, month, day)
  "#{Gameday::GD2_MLB_BASE}/mlb/year_" + @@year + "/month_" + @@month + "/day_" + @@day + "/gid_"+gid+"/inning/inning_hit.xml"
end

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



90
91
92
93
# File 'lib/gameday_url_builder.rb', line 90

def self.build_inning_scores_url(year, month, day, gid)
  set_date_vars(year, month, day)
  "#{Gameday::GD2_MLB_BASE}/mlb/year_" + @@year + "/month_" + @@month + "/day_" + @@day + "/gid_"+gid+"/inning/inning_Scores.xml"
end

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



84
85
86
87
# File 'lib/gameday_url_builder.rb', line 84

def self.build_inningx_url(year, month, day, gid, inning_num)
  set_date_vars(year, month, day)
  "#{Gameday::GD2_MLB_BASE}/mlb/year_" + @@year + "/month_" + @@month + "/day_" + @@day + "/gid_"+gid+"/inning/inning_#{inning_num}.xml"
end

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



60
61
62
63
# File 'lib/gameday_url_builder.rb', line 60

def self.build_linescore_url(year, month, day, gid)
  set_date_vars(year, month, day)
  "#{Gameday::GD2_MLB_BASE}/mlb/year_" + @@year + "/month_" + @@month + "/day_" + @@day + "/gid_"+gid+"/linescore.xml" 
end

.build_month_url(year, month) ⇒ Object



108
109
110
111
# File 'lib/gameday_url_builder.rb', line 108

def self.build_month_url(year, month)
  set_date_vars(year, month, nil)
  "#{Gameday::GD2_MLB_BASE}/mlb/year_#{@@year}/month_#{@@month}/"
end

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



78
79
80
81
# File 'lib/gameday_url_builder.rb', line 78

def self.build_pitcher_url(year, month, day, gid, pid)
  set_date_vars(year, month, day)
  "#{Gameday::GD2_MLB_BASE}/mlb/year_" + @@year + "/month_" + @@month + "/day_" + @@day + "/gid_"+gid+"/pitchers/" +  pid + '.xml' 
end

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



66
67
68
69
# File 'lib/gameday_url_builder.rb', line 66

def self.build_players_url(year, month, day, gid)
  set_date_vars(year, month, day)
  "#{Gameday::GD2_MLB_BASE}/mlb/year_" + @@year + "/month_" + @@month + "/day_" + @@day + "/gid_"+gid+"/players.xml" 
end

.build_scoreboard_url(year, month, day) ⇒ Object



24
25
26
27
# File 'lib/gameday_url_builder.rb', line 24

def self.build_scoreboard_url(year, month, day)
  set_date_vars(year, month, day)
  "#{Gameday::GD2_MLB_BASE}/mlb/year_" + @@year + "/month_" + @@month + "/day_" + @@day + "/master_scoreboard.xml"
end