Class: Gameday::Game
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Gameday::Game
- Defined in:
- lib/gameday/game.rb
Instance Attribute Summary collapse
-
#scoreboard ⇒ Object
Returns the value of attribute scoreboard.
Instance Method Summary collapse
- #__getobj__ ⇒ Object
- #away_code ⇒ Object
- #away_pitcher ⇒ Object
- #boxscore_base_url ⇒ Object
- #boxscore_path ⇒ Object
- #day ⇒ Object
- #home_code ⇒ Object
- #home_pitcher ⇒ Object
-
#initialize(game_obj, scoreboard) ⇒ Game
constructor
A new instance of Game.
- #month ⇒ Object
- #year ⇒ Object
Constructor Details
#initialize(game_obj, scoreboard) ⇒ Game
Returns a new instance of Game.
10 11 12 13 |
# File 'lib/gameday/game.rb', line 10 def initialize(game_obj, scoreboard) @game = game_obj @scoreboard = scoreboard end |
Instance Attribute Details
#scoreboard ⇒ Object
Returns the value of attribute scoreboard.
4 5 6 |
# File 'lib/gameday/game.rb', line 4 def scoreboard @scoreboard end |
Instance Method Details
#__getobj__ ⇒ Object
6 7 8 |
# File 'lib/gameday/game.rb', line 6 def __getobj__ @game end |
#away_code ⇒ Object
15 16 17 |
# File 'lib/gameday/game.rb', line 15 def away_code self["away_code"] end |
#away_pitcher ⇒ Object
27 28 29 |
# File 'lib/gameday/game.rb', line 27 def away_pitcher Gameday::Pitcher.new(self["away_probable_pitcher"]) end |
#boxscore_base_url ⇒ Object
41 42 43 |
# File 'lib/gameday/game.rb', line 41 def boxscore_base_url Gameday::BASE_URL end |
#boxscore_path ⇒ Object
45 46 47 |
# File 'lib/gameday/game.rb', line 45 def boxscore_path "/components/game/mlb/year_#{year}/month_#{month}/day_#{day}/gid_#{year}_#{month}_#{day}_#{away_code}mlb_#{home_code}mlb_1/boxscore.json" end |
#day ⇒ Object
37 38 39 |
# File 'lib/gameday/game.rb', line 37 def day scoreboard.day end |
#home_code ⇒ Object
19 20 21 |
# File 'lib/gameday/game.rb', line 19 def home_code self["home_code"] end |
#home_pitcher ⇒ Object
23 24 25 |
# File 'lib/gameday/game.rb', line 23 def home_pitcher Gameday::Pitcher.new(self["home_probable_pitcher"]) end |
#month ⇒ Object
34 35 36 |
# File 'lib/gameday/game.rb', line 34 def month scoreboard.month end |
#year ⇒ Object
31 32 33 |
# File 'lib/gameday/game.rb', line 31 def year scoreboard.year end |