Class: NbaRb::Game::Hustle

Inherits:
BaseClass show all
Defined in:
lib/nba_rb/game/hustle.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from StatsRequest

#stats_request

Methods included from StatsHash

#create_stats_hash

Constructor Details

#initialize(*args) ⇒ Hustle

Returns a new instance of Hustle.



8
9
10
11
12
13
14
# File 'lib/nba_rb/game/hustle.rb', line 8

def initialize(*args)
  super(*args)

  res = stats_request(endpoint, 'GameID' => game_id)

  @data = res['resultSets']
end

Instance Attribute Details

#game_idObject

Returns the value of attribute game_id.



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

def game_id
  @game_id
end

Instance Method Details

#hustle_stats_availableObject



16
17
18
# File 'lib/nba_rb/game/hustle.rb', line 16

def hustle_stats_available
  create_stats_hash(@data[0])
end

#hustle_stats_player_box_scoreObject



20
21
22
# File 'lib/nba_rb/game/hustle.rb', line 20

def hustle_stats_player_box_score
  create_stats_hash(@data[1])
end

#hustle_stats_team_box_scoreObject



24
25
26
# File 'lib/nba_rb/game/hustle.rb', line 24

def hustle_stats_team_box_score
  create_stats_hash(@data[2])
end