Class: NbaRb::Game::BoxscoreScoring

Inherits:
Boxscore show all
Defined in:
lib/nba_rb/game/boxscore_scoring.rb

Instance Attribute Summary

Attributes inherited from Boxscore

#data, #end_period, #end_range, #game_id, #range_type, #start_period, #start_range

Instance Method Summary collapse

Methods inherited from Boxscore

#initialize, #player_stats, #team_starter_bench_stats, #team_stats

Methods included from StatsRequest

#stats_request

Methods included from Initializable

#initialize

Methods included from StatsHash

#create_stats_hash

Constructor Details

This class inherits a constructor from NbaRb::Game::Boxscore

Instance Method Details

#endpointObject



6
7
8
# File 'lib/nba_rb/game/boxscore_scoring.rb', line 6

def endpoint
  self.class.endpoint
end

#matchupObject



10
11
12
13
14
15
# File 'lib/nba_rb/game/boxscore_scoring.rb', line 10

def matchup
  scores = players_scoring
  home_team = scores[0]['TEAM_ABBREVIATION']
  away_team = scores.last['TEAM_ABBREVIATION']
  "#{away_team} @ #{home_team}"
end

#players_scoringObject



17
18
19
# File 'lib/nba_rb/game/boxscore_scoring.rb', line 17

def players_scoring
  create_stats_hash(@data[0])
end

#team_scoringObject



21
22
23
# File 'lib/nba_rb/game/boxscore_scoring.rb', line 21

def team_scoring
  create_stats_hash(@data[1])
end