Module: NBA::InfographicFanDuelPlayer

Defined in:
lib/nba/infographic_fan_duel_player.rb

Overview

Provides methods to retrieve FanDuel infographic player statistics

Constant Summary collapse

FAN_DUEL_PLAYER =

Result set name for FanDuel player stats

Returns:

  • (String)

    the result set name

"FanDuelPlayer".freeze

Class Method Summary collapse

Class Method Details

.find(game:, client: CLIENT) ⇒ Collection

Retrieves FanDuel infographic statistics for all players in a game

Examples:

stats = NBA::InfographicFanDuelPlayer.find(game: "0022400001")
stats.each { |s| puts "#{s.player_name}: #{s.fan_duel_pts} FD pts" }

Parameters:

  • game (String, Game)

    the game ID or Game object

  • client (Client) (defaults to: CLIENT)

    the API client to use

Returns:

  • (Collection)

    a collection of FanDuel player stats



23
24
25
26
27
28
# File 'lib/nba/infographic_fan_duel_player.rb', line 23

def self.find(game:, client: CLIENT)
  game_id = Utils.extract_id(game)
  path = "infographicfanduelplayer?GameID=#{game_id}"
  response = client.get(path)
  parse_response(response, game_id)
end