Module: Fantasydata::API::Fantasy

Includes:
Utils
Included in:
Client
Defined in:
lib/fantasydata/api/fantasy.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

#daily_fantasy_defense_game_projected_stats(year, week) ⇒ Object



42
43
44
# File 'lib/fantasydata/api/fantasy.rb', line 42

def daily_fantasy_defense_game_projected_stats year, week
  objects_from_response(Fantasydata::DailyFantasyPlayerStats, :get, "/nfl/v2/JSON/FantasyDefenseProjectionsByGame/#{year}/#{week}")
end

#daily_fantasy_defense_game_stats(year, week) ⇒ Object



38
39
40
# File 'lib/fantasydata/api/fantasy.rb', line 38

def daily_fantasy_defense_game_stats year, week
  objects_from_response(Fantasydata::DailyFantasyPlayerStats, :get, "/nfl/v2/JSON/FantasyDefenseByGame/#{year}/#{week}")
end

#daily_fantasy_defense_season_projected_stats(year) ⇒ Object



50
51
52
# File 'lib/fantasydata/api/fantasy.rb', line 50

def daily_fantasy_defense_season_projected_stats year
  objects_from_response(Fantasydata::DailyFantasyPlayerStats, :get, "/nfl/v2/JSON/FantasyDefenseProjectionsBySeason/#{year}")
end

#daily_fantasy_defense_season_stats(year) ⇒ Object



46
47
48
# File 'lib/fantasydata/api/fantasy.rb', line 46

def daily_fantasy_defense_season_stats year
  objects_from_response(Fantasydata::DailyFantasyPlayerStats, :get, "/nfl/v2/JSON/FantasyDefenseBySeason/#{year}")
end

#daily_fantasy_players_for_day(day) ⇒ Fantasydata::BoxScore

Gets daily fantasy player information for given day.

Examples:

daily_fantasy_for_day

Fantasydata.daily_fantasy_for_day('2014-SEP-21')

Parameters:

  • season (String)

    Year of the season and the season type. If no season type is provided, then the default is regular season Examples: 2015REG, 2015PRE, 2015POST, 2015

Returns:

Raises:

See Also:



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

def daily_fantasy_players_for_day(day)
  day = convert_to_date(day)
  objects_from_response(Fantasydata::DailyFantasyPlayer, :get, "/nfl/v2/JSON/DailyFantasyPlayers/#{day}")
end

#daily_fantasy_points_for_day(day) ⇒ Fantasydata::BoxScore

Get daily fantasy points for a given day.

Examples:

daily_fantasy_for_day

Fantasydata.daily_fantasy_for_day('2014-SEP-21')

Parameters:

  • season (String)

    Year of the season and the season type. If no season type is provided, then the default is regular season Examples: 2015REG, 2015PRE, 2015POST, 2015

Returns:

Raises:

See Also:



33
34
35
36
# File 'lib/fantasydata/api/fantasy.rb', line 33

def daily_fantasy_points_for_day(day)
  day = convert_to_date(day)
  objects_from_response(Fantasydata::DailyFantasyPoints, :get, "/nfl/v2/JSON/DailyFantasyPoints/#{day}")
end

#fantasy_players_adpObject



54
55
56
# File 'lib/fantasydata/api/fantasy.rb', line 54

def fantasy_players_adp
  objects_from_response(Fantasydata::FantasyPlayerAdp, :get, "/nfl/v2/JSON/FantasyPlayers")
end