Module: NbaStats::PlayByPlay

Included in:
Client
Defined in:
lib/nba_stats/stats/play_by_play.rb

Constant Summary collapse

PLAY_BY_PLAY_PATH =

The path of the playbyplay API

'/stats/playbyplay'

Instance Method Summary collapse

Instance Method Details

#play_by_play(game_id, start_period = 0, end_period = 0) ⇒ NbaStats::Resources::PlayByPlay

Calls the playbyplay API and returns a PlayByPlay resource.

Parameters:

  • game_id (String)
  • start_period (Integer) (defaults to: 0)
  • end_period (Integer) (defaults to: 0)

Returns:



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/nba_stats/stats/play_by_play.rb', line 16

def play_by_play(
    game_id,
    start_period=0,
    end_period=0
)
  NbaStats::Resources::PlayByPlay.new(
      get(PLAY_BY_PLAY_PATH, {
          :GameID => game_id,
          :StartPeriod => start_period,
          :EndPeriod => end_period
      })
  )
end