Module: NBA::LiveScoreboard

Defined in:
lib/nba/live_scoreboard.rb

Overview

Provides methods to retrieve live NBA scoreboard data

Class Method Summary collapse

Class Method Details

.today(client: LIVE_CLIENT) ⇒ Collection

Retrieves today’s live scoreboard

Examples:

games = NBA::LiveScoreboard.today
games.each { |g| puts "#{g.away_team_tricode} #{g.away_team_score} @ #{g.home_team_tricode} #{g.home_team_score}" }

Parameters:

  • client (LiveConnection) (defaults to: LIVE_CLIENT)

    the API client to use

Returns:



20
21
22
23
24
# File 'lib/nba/live_scoreboard.rb', line 20

def self.today(client: LIVE_CLIENT)
  path = "scoreboard/todaysScoreboard_00.json"
  response = client.get(path)
  parse_response(response)
end