Module: Fantasydata::API::BoxScore

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

#box_score_by_team(season, week, home_team) ⇒ Fantasydata::BoxScore

This method returns individual box scores for a given season, week and home team.

Examples:

box_score_by_team

Fantasydata.box_score_by_team('2015REG', 15, 'MIN')

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

  • week (Integer)

    Week of the season. Valid values are as follows: Preseason 0 to 4, Regular Season 1 to 17, Postseason 1 to 4

  • hometeam (String)

    Abbreviation of the home team. Example: WAS

Returns:

Raises:

See Also:



20
21
22
# File 'lib/fantasydata/api/box_score.rb', line 20

def box_score_by_team(season, week, home_team)
  object_from_response(Fantasydata::BoxScore, :get, "/nfl/v2/JSON/BoxScore/#{season}/#{week}/#{home_team}")
end

#box_scores_activeArray<Fantasydata::BoxScore>

This method returns box scores for all games that are either in-progress or have been updated within the last 30 minutes.

Examples:

box_scores_active

Fantasydata.box_scores_active

Returns:

Raises:

See Also:



49
50
51
# File 'lib/fantasydata/api/box_score.rb', line 49

def box_scores_active
  objects_from_response(Fantasydata::BoxScore, :get, "/nfl/v2/JSON/ActiveBoxScores")
end

#box_scores_by_week(season, week) ⇒ Array<Fantasydata::BoxScore>

This method returns all box scores for a given season and week.

Examples:

box_scores_by_week

Fantasydata.box_scores_by_week('2015REG', 15)

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

  • week (Integer)

    Week of the season. Valid values are as follows: Preseason 0 to 4, Regular Season 1 to 17, Postseason 1 to 4

Returns:

Raises:

See Also:



36
37
38
# File 'lib/fantasydata/api/box_score.rb', line 36

def box_scores_by_week(season, week)
  objects_from_response(Fantasydata::BoxScore, :get, "/nfl/v2/JSON/BoxScores/#{season}/#{week}")
end

#box_scores_delta(season, week, minutes) ⇒ Array<Fantasydata::BoxScore>

This method returns all box scores for a given season and week, but only returns player stats that have changed in the last X minutes.

Examples:

box_scores_delta

Fantasydata.box_scores_delta('2014REG', 1, 5)

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

  • week (Integer)

    Week of the season. Valid values are as follows: Preseason 0 to 4, Regular Season 1 to 17, Postseason 1 to 4

  • minutes (Integer)

    Only returns player statistics that have changed in the last X minutes. You specify how many minutes in time to go back. Valid entries are: 1 or 2 (etc.)

Returns:

Raises:

See Also:



65
66
67
# File 'lib/fantasydata/api/box_score.rb', line 65

def box_scores_delta(season, week, minutes)
  objects_from_response(Fantasydata::BoxScore, :get, "/nfl/v2/JSON/BoxScoresDelta/#{season}/#{week}/#{minutes}")
end

#box_scores_delta_current_week(minutes) ⇒ Array<Fantasydata::BoxScore>

This method returns all box scores for the current week, but only returns player stats that have changed in the last X minutes.

Examples:

box_scores_delta_current_week

Fantasydata.box_scores_delta_current_week(5)

Parameters:

  • minutes (Integer)

    Only returns player statistics that have changed in the last X minutes. You specify how many minutes in time to go back. Valid entries are: 1 or 2 (etc.)

Returns:

Raises:

See Also:



79
80
81
# File 'lib/fantasydata/api/box_score.rb', line 79

def box_scores_delta_current_week(minutes)
  objects_from_response(Fantasydata::BoxScore, :get, "/nfl/v2/JSON/RecentlyUpdatedBoxScores/#{minutes}")
end

#box_scores_finalArray<Fantasydata::BoxScore>

Examples:

box_scores_final

Fantasydata.box_scores_final

Returns:

Raises:

See Also:



92
93
# File 'lib/fantasydata/api/box_score.rb', line 92

def box_scores_final
end

#box_scores_liveArray<Fantasydata::BoxScore>

Examples:

box_scores_live

Fantasydata.box_scores_live

Returns:

Raises:

See Also:



104
105
# File 'lib/fantasydata/api/box_score.rb', line 104

def box_scores_live
end