Module: Fantasydata::API::Game

Includes:
Utils
Included in:
Client
Defined in:
lib/fantasydata/api/game.rb

Constant Summary

Constants included from Utils

Utils::API_KEY_CANNOT_CALL_THIS_METHOD, Utils::INVALID_PARAMETER, Utils::MISSING_OR_INVALID_KEY, Utils::MISSING_PARAMETER, Utils::RATE_LIMIT_EXCEEDED, Utils::SUCCESS

Instance Method Summary collapse

Instance Method Details

#game_stats_by_season(year) ⇒ Object



26
27
28
# File 'lib/fantasydata/api/game.rb', line 26

def game_stats_by_season(year)
  objects_from_response(Fantasydata::GameStat, :get, "/nfl/v2/JSON/GameStats/#{year}")
end

#game_stats_by_week(year, week) ⇒ Object



22
23
24
# File 'lib/fantasydata/api/game.rb', line 22

def game_stats_by_week(year, week)
  objects_from_response(Fantasydata::GameStat, :get, "/nfl/v2/JSON/GameStatsByWeek/#{year}/#{week}")
end

#games_in_progress?boolean

Returns true if there is at least one game being played at the time of the request or false if there are none.

Examples:

games_in_progress

Fantasydata.games_in_progress?

Returns:

  • (boolean)

Raises:

See Also:



18
19
20
# File 'lib/fantasydata/api/game.rb', line 18

def games_in_progress?()
  boolean_from_response(:get, '/nfl/v2/JSON/AreAnyGamesInProgress')
end