Class: NbaRb::Game::Boxscore
- Defined in:
- lib/nba_rb/game/boxscore.rb
Direct Known Subclasses
BoxscoreAdvanced, BoxscoreFourFactors, BoxscoreMisc, BoxscoreScoring, BoxscoreUsage
Class Attribute Summary collapse
-
.endpoint ⇒ Object
readonly
Returns the value of attribute endpoint.
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#end_period ⇒ Object
Returns the value of attribute end_period.
-
#end_range ⇒ Object
Returns the value of attribute end_range.
-
#game_id ⇒ Object
Returns the value of attribute game_id.
-
#range_type ⇒ Object
Returns the value of attribute range_type.
-
#start_period ⇒ Object
Returns the value of attribute start_period.
-
#start_range ⇒ Object
Returns the value of attribute start_range.
Instance Method Summary collapse
- #endpoint ⇒ Object
-
#initialize(*args) ⇒ Boxscore
constructor
A new instance of Boxscore.
- #player_stats ⇒ Object
- #team_starter_bench_stats ⇒ Object
- #team_stats ⇒ Object
Methods included from StatsRequest
Methods included from StatsHash
Constructor Details
#initialize(*args) ⇒ Boxscore
Returns a new instance of Boxscore.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/nba_rb/game/boxscore.rb', line 22 def initialize(*args) super(*args) @range_type ||= NbaRb::RangeType.default @start_period ||= NbaRb::Period.default @end_period ||= NbaRb::Period.default @start_range ||= NbaRb::StartRange.default @end_range ||= NbaRb::EndRange.default res = stats_request(endpoint, 'GameID' => game_id, 'RangeType' => range_type, 'StartPeriod' => start_period, 'EndPeriod' => end_period, 'StartRange' => start_range, 'EndRange' => end_range) @data = res['resultSets'] end |
Class Attribute Details
.endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
7 8 9 |
# File 'lib/nba_rb/game/boxscore.rb', line 7 def endpoint @endpoint end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
14 15 16 |
# File 'lib/nba_rb/game/boxscore.rb', line 14 def data @data end |
#end_period ⇒ Object
Returns the value of attribute end_period.
14 15 16 |
# File 'lib/nba_rb/game/boxscore.rb', line 14 def end_period @end_period end |
#end_range ⇒ Object
Returns the value of attribute end_range.
14 15 16 |
# File 'lib/nba_rb/game/boxscore.rb', line 14 def end_range @end_range end |
#game_id ⇒ Object
Returns the value of attribute game_id.
14 15 16 |
# File 'lib/nba_rb/game/boxscore.rb', line 14 def game_id @game_id end |
#range_type ⇒ Object
Returns the value of attribute range_type.
14 15 16 |
# File 'lib/nba_rb/game/boxscore.rb', line 14 def range_type @range_type end |
#start_period ⇒ Object
Returns the value of attribute start_period.
14 15 16 |
# File 'lib/nba_rb/game/boxscore.rb', line 14 def start_period @start_period end |
#start_range ⇒ Object
Returns the value of attribute start_range.
14 15 16 |
# File 'lib/nba_rb/game/boxscore.rb', line 14 def start_range @start_range end |
Instance Method Details
#endpoint ⇒ Object
10 11 12 |
# File 'lib/nba_rb/game/boxscore.rb', line 10 def endpoint self.class.endpoint end |
#player_stats ⇒ Object
41 42 43 |
# File 'lib/nba_rb/game/boxscore.rb', line 41 def player_stats create_stats_hash(@data[0]) end |
#team_starter_bench_stats ⇒ Object
49 50 51 |
# File 'lib/nba_rb/game/boxscore.rb', line 49 def team_starter_bench_stats create_stats_hash(@data[2]) end |
#team_stats ⇒ Object
45 46 47 |
# File 'lib/nba_rb/game/boxscore.rb', line 45 def team_stats create_stats_hash(@data[1]) end |