Class: NbaRb::Player::Summary
- Inherits:
-
Object
- Object
- NbaRb::Player::Summary
- Includes:
- Initializable, StatsHash, StatsRequest
- Defined in:
- lib/nba_rb/player/summary.rb,
lib/nba_rb/player/player_summary.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#player_id ⇒ Object
Returns the value of attribute player_id.
Instance Method Summary collapse
- #headline_stats ⇒ Object
- #info ⇒ Object
-
#initialize(*args) ⇒ Summary
constructor
A new instance of Summary.
Methods included from StatsHash
Methods included from StatsRequest
Constructor Details
#initialize(*args) ⇒ Summary
11 12 13 14 15 16 17 18 |
# File 'lib/nba_rb/player/summary.rb', line 11 def initialize(*args) super(*args) @player_id ||= player_id res = stats_request('commonplayerinfo', 'PlayerID' => player_id) @data = res['resultSets'] end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
8 9 10 |
# File 'lib/nba_rb/player/summary.rb', line 8 def data @data end |
#player_id ⇒ Object
Returns the value of attribute player_id.
8 9 10 |
# File 'lib/nba_rb/player/summary.rb', line 8 def player_id @player_id end |
Instance Method Details
#headline_stats ⇒ Object
24 25 26 |
# File 'lib/nba_rb/player/summary.rb', line 24 def headline_stats create_stats_hash(@data[1]) end |
#info ⇒ Object
20 21 22 |
# File 'lib/nba_rb/player/summary.rb', line 20 def info create_stats_hash(@data[0]) end |