Class: NbaRb::Game::BoxscoreSummary

Inherits:
BaseClass
  • Object
show all
Defined in:
lib/nba_rb/game/boxscore_summary.rb

Class Attribute Summary collapse

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) ⇒ BoxscoreSummary

Returns a new instance of BoxscoreSummary.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/nba_rb/game/boxscore_summary.rb', line 24

def initialize(*args)
  super(*args)

  @season ||= NbaRb::CURRENT_SEASON
  @season_type ||= NbaRb::SeasonType.default
  @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,
                                'Season' => season,
                                'SeasonType' => season_type,
                                'RangeType' => range_type,
                                'StartPeriod' => start_period,
                                'EndPeriod' => end_period,
                                'StartRange' => start_range,
                                'EndRange' => end_range)

  @data = res['resultSets']
end

Class Attribute Details

.endpointObject (readonly)

Returns the value of attribute endpoint.



7
8
9
# File 'lib/nba_rb/game/boxscore_summary.rb', line 7

def endpoint
  @endpoint
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



14
15
16
# File 'lib/nba_rb/game/boxscore_summary.rb', line 14

def data
  @data
end

#end_periodObject

Returns the value of attribute end_period.



14
15
16
# File 'lib/nba_rb/game/boxscore_summary.rb', line 14

def end_period
  @end_period
end

#end_rangeObject

Returns the value of attribute end_range.



14
15
16
# File 'lib/nba_rb/game/boxscore_summary.rb', line 14

def end_range
  @end_range
end

#game_idObject

Returns the value of attribute game_id.



14
15
16
# File 'lib/nba_rb/game/boxscore_summary.rb', line 14

def game_id
  @game_id
end

#range_typeObject

Returns the value of attribute range_type.



14
15
16
# File 'lib/nba_rb/game/boxscore_summary.rb', line 14

def range_type
  @range_type
end

#seasonObject

Returns the value of attribute season.



14
15
16
# File 'lib/nba_rb/game/boxscore_summary.rb', line 14

def season
  @season
end

#season_typeObject

Returns the value of attribute season_type.



14
15
16
# File 'lib/nba_rb/game/boxscore_summary.rb', line 14

def season_type
  @season_type
end

#start_periodObject

Returns the value of attribute start_period.



14
15
16
# File 'lib/nba_rb/game/boxscore_summary.rb', line 14

def start_period
  @start_period
end

#start_rangeObject

Returns the value of attribute start_range.



14
15
16
# File 'lib/nba_rb/game/boxscore_summary.rb', line 14

def start_range
  @start_range
end

Instance Method Details

#available_videoObject



79
80
81
# File 'lib/nba_rb/game/boxscore_summary.rb', line 79

def available_video
  create_stats_hash(@data[8])
end

#endpointObject



10
11
12
# File 'lib/nba_rb/game/boxscore_summary.rb', line 10

def endpoint
  self.class.endpoint
end

#game_infoObject



63
64
65
# File 'lib/nba_rb/game/boxscore_summary.rb', line 63

def game_info
  create_stats_hash(@data[4])
end

#game_summaryObject



47
48
49
# File 'lib/nba_rb/game/boxscore_summary.rb', line 47

def game_summary
  create_stats_hash(@data[0])
end

#inactive_playersObject



59
60
61
# File 'lib/nba_rb/game/boxscore_summary.rb', line 59

def inactive_players
  create_stats_hash(@data[3])
end

#last_meetingObject



71
72
73
# File 'lib/nba_rb/game/boxscore_summary.rb', line 71

def last_meeting
  create_stats_hash(@data[6])
end

#line_scoreObject



67
68
69
# File 'lib/nba_rb/game/boxscore_summary.rb', line 67

def line_score
  create_stats_hash(@data[5])
end

#officialsObject



55
56
57
# File 'lib/nba_rb/game/boxscore_summary.rb', line 55

def officials
  create_stats_hash(@data[2])
end

#other_statsObject



51
52
53
# File 'lib/nba_rb/game/boxscore_summary.rb', line 51

def other_stats
  create_stats_hash(@data[1])
end

#season_seriesObject



75
76
77
# File 'lib/nba_rb/game/boxscore_summary.rb', line 75

def season_series
  create_stats_hash(@data[7])
end