Module: NbaStats::BoxScore

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

Constant Summary collapse

BOX_SCORE_PATH =

The path of the boxscore API

'/stats/boxscore'

Instance Method Summary collapse

Instance Method Details

#box_score(game_id, range_type = 0, start_period = 0, end_period = 0, start_range = 0, end_range = 0) ⇒ NbaStats::Resources::BoxScore

Calls the boxscore API and returns a BoxScore resource.

Parameters:

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

Returns:



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/nba_stats/stats/box_score.rb', line 20

def box_score(
    game_id,
    range_type=0,
    start_period=0,
    end_period=0,
    start_range=0,
    end_range=0
)
  NbaStats::Resources::BoxScore.new(
      get(BOX_SCORE_PATH, {
          :GameID => game_id,
          :RangeType => range_type,
          :StartPeriod => start_period,
          :EndPeriod => end_period,
          :StartRange => start_range,
          :EndRange => end_range
      })
  )
end