Class: NbaRb::Player::Dashboard
- Inherits:
-
Object
- Object
- NbaRb::Player::Dashboard
- Includes:
- Initializable, StatsHash, StatsRequest
- Defined in:
- lib/nba_rb/player/dashboard.rb,
lib/nba_rb/player/player_dashboard.rb
Direct Known Subclasses
ClutchSplits, DefenseTracking, PassTracking, ReboundLogTracking, ReboundTracking, ShotLogTracking, ShotTracking
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.
-
#date_from ⇒ Object
Returns the value of attribute date_from.
-
#date_to ⇒ Object
Returns the value of attribute date_to.
-
#game_segment ⇒ Object
Returns the value of attribute game_segment.
-
#last_n_games ⇒ Object
Returns the value of attribute last_n_games.
-
#league_id ⇒ Object
Returns the value of attribute league_id.
-
#location ⇒ Object
Returns the value of attribute location.
-
#measure_type ⇒ Object
Returns the value of attribute measure_type.
-
#month ⇒ Object
Returns the value of attribute month.
-
#opponent_team_id ⇒ Object
Returns the value of attribute opponent_team_id.
-
#outcome ⇒ Object
Returns the value of attribute outcome.
-
#pace_adjust ⇒ Object
Returns the value of attribute pace_adjust.
-
#per_mode ⇒ Object
Returns the value of attribute per_mode.
-
#period ⇒ Object
Returns the value of attribute period.
-
#player_id ⇒ Object
Returns the value of attribute player_id.
-
#plus_minus ⇒ Object
Returns the value of attribute plus_minus.
-
#po_round ⇒ Object
Returns the value of attribute po_round.
-
#rank ⇒ Object
Returns the value of attribute rank.
-
#season ⇒ Object
Returns the value of attribute season.
-
#season_segment ⇒ Object
Returns the value of attribute season_segment.
-
#season_type ⇒ Object
Returns the value of attribute season_type.
-
#shot_clock_range ⇒ Object
Returns the value of attribute shot_clock_range.
-
#team_id ⇒ Object
Returns the value of attribute team_id.
-
#vs_conference ⇒ Object
Returns the value of attribute vs_conference.
-
#vs_division ⇒ Object
Returns the value of attribute vs_division.
Instance Method Summary collapse
- #endpoint ⇒ Object
-
#initialize(*args) ⇒ Dashboard
constructor
A new instance of Dashboard.
- #overall ⇒ Object
Methods included from StatsHash
Methods included from StatsRequest
Constructor Details
#initialize(*args) ⇒ Dashboard
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/nba_rb/player/dashboard.rb', line 44 def initialize(*args) super(*args) @team_id ||= 0 @measure_type ||= NbaRb::MeasureType.default @per_mode ||= NbaRb::PerMode.default @plus_minus ||= NbaRb::PlusMinus.default @pace_adjust ||= NbaRb::PaceAdjust.default @rank ||= NbaRb::PaceAdjust.default @league_id ||= NbaRb::League.default @season ||= NbaRb::CURRENT_SEASON @season_type ||= NbaRb::SeasonType.default @po_round ||= NbaRb::PlayoffRound.default @outcome ||= NbaRb::Outcome.default @location ||= NbaRb::Location.default @month ||= NbaRb::Month.default @season_segment ||= NbaRb::SeasonSegment.default @date_from ||= NbaRb::DateFrom.default @date_to ||= NbaRb::DateTo.default @opponent_team_id ||= NbaRb::OpponentTeamID.default @vs_conference ||= NbaRb::VsConference.default @vs_division ||= NbaRb::VsDivision.default @game_segment ||= NbaRb::GameSegment.default @period ||= NbaRb::Period.default @shot_clock_range ||= NbaRb::ShotClockRange.default @last_n_games ||= NbaRb::LastNGames.default res = stats_request(endpoint, 'PlayerID' => player_id, 'TeamID' => team_id, 'MeasureType' => measure_type, 'PerMode' => per_mode, 'PlusMinus' => plus_minus, 'PaceAdjust' => pace_adjust, 'Rank' => rank, 'LeagueID' => league_id, 'Season' => season, 'SeasonType' => season_type, 'PORound' => po_round, 'Outcome' => outcome, 'Location' => location, 'Month' => month, 'SeasonSegment' => season_segment, 'DateFrom' => date_from, 'DateTo' => date_to, 'OpponentTeamID' => opponent_team_id, 'VsConference' => vs_conference, 'VsDivision' => vs_division, 'GameSegment' => game_segment, 'Period' => period, 'ShotClockRange' => shot_clock_range, 'LastNGames' => last_n_games) @data = res['resultSets'] end |
Class Attribute Details
.endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
9 10 11 |
# File 'lib/nba_rb/player/dashboard.rb', line 9 def endpoint @endpoint end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def data @data end |
#date_from ⇒ Object
Returns the value of attribute date_from.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def date_from @date_from end |
#date_to ⇒ Object
Returns the value of attribute date_to.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def date_to @date_to end |
#game_segment ⇒ Object
Returns the value of attribute game_segment.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def game_segment @game_segment end |
#last_n_games ⇒ Object
Returns the value of attribute last_n_games.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def last_n_games @last_n_games end |
#league_id ⇒ Object
Returns the value of attribute league_id.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def league_id @league_id end |
#location ⇒ Object
Returns the value of attribute location.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def location @location end |
#measure_type ⇒ Object
Returns the value of attribute measure_type.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def measure_type @measure_type end |
#month ⇒ Object
Returns the value of attribute month.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def month @month end |
#opponent_team_id ⇒ Object
Returns the value of attribute opponent_team_id.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def opponent_team_id @opponent_team_id end |
#outcome ⇒ Object
Returns the value of attribute outcome.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def outcome @outcome end |
#pace_adjust ⇒ Object
Returns the value of attribute pace_adjust.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def pace_adjust @pace_adjust end |
#per_mode ⇒ Object
Returns the value of attribute per_mode.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def per_mode @per_mode end |
#period ⇒ Object
Returns the value of attribute period.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def period @period end |
#player_id ⇒ Object
Returns the value of attribute player_id.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def player_id @player_id end |
#plus_minus ⇒ Object
Returns the value of attribute plus_minus.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def plus_minus @plus_minus end |
#po_round ⇒ Object
Returns the value of attribute po_round.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def po_round @po_round end |
#rank ⇒ Object
Returns the value of attribute rank.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def rank @rank end |
#season ⇒ Object
Returns the value of attribute season.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def season @season end |
#season_segment ⇒ Object
Returns the value of attribute season_segment.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def season_segment @season_segment end |
#season_type ⇒ Object
Returns the value of attribute season_type.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def season_type @season_type end |
#shot_clock_range ⇒ Object
Returns the value of attribute shot_clock_range.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def shot_clock_range @shot_clock_range end |
#team_id ⇒ Object
Returns the value of attribute team_id.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def team_id @team_id end |
#vs_conference ⇒ Object
Returns the value of attribute vs_conference.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def vs_conference @vs_conference end |
#vs_division ⇒ Object
Returns the value of attribute vs_division.
16 17 18 |
# File 'lib/nba_rb/player/dashboard.rb', line 16 def vs_division @vs_division end |
Instance Method Details
#endpoint ⇒ Object
12 13 14 |
# File 'lib/nba_rb/player/dashboard.rb', line 12 def endpoint self.class.endpoint end |
#overall ⇒ Object
99 100 101 |
# File 'lib/nba_rb/player/dashboard.rb', line 99 def overall create_stats_hash(@data[0]) end |