Class: YahooSports::MLB

Inherits:
Base
  • Object
show all
Defined in:
lib/yahoo_sports/mlb.rb

Class Method Summary collapse

Class Method Details

.get_homepage_games(state = "") ⇒ Array<OpenStruct>

Get the MLB scoreboard games. Includes recently completed, live and upcoming games.

Source: sports.yahoo.com/mlb

Game struct has the following keys:

game.date   # date of game; includes time if preview
game.team1  # visiting team
game.team2  # home team
game.score1 # team1's score, if live or final
game.score2 # team2's score, if live or final
game.state  # live, final or preview
game.tv     # TV station showing the game, if preview and available

Parameters:

  • state (String) (defaults to: "")

    Optionally filter for the given state (“live”, “final”, or “preview”)

Returns:

  • (Array<OpenStruct>)

    list of games


23
24
25
# File 'lib/yahoo_sports/mlb.rb', line 23

def self.get_homepage_games(state = "")
    super("mlb", state)
end