Class: NbaRb::Team::Summary
- Defined in:
- lib/nba_rb/team/summary.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#league_id ⇒ Object
Returns the value of attribute league_id.
-
#season ⇒ Object
Returns the value of attribute season.
-
#season_type ⇒ Object
Returns the value of attribute season_type.
-
#team_id ⇒ Object
Returns the value of attribute team_id.
Instance Method Summary collapse
- #info ⇒ Object
-
#initialize(*args) ⇒ Summary
constructor
A new instance of Summary.
- #season_ranks ⇒ Object
Methods included from StatsRequest
Methods included from StatsHash
Constructor Details
#initialize(*args) ⇒ Summary
Returns a new instance of Summary.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/nba_rb/team/summary.rb', line 10 def initialize(*args) super(*args) @season ||= NbaRb::CURRENT_SEASON @league_id ||= NbaRb::League.NBA @season_type ||= NbaRb::SeasonType.default res = stats_request('teaminfocommon', 'TeamID' => team_id, 'Season' => season, 'LeagueID' => league_id, 'SeasonType' => season_type) @data = res['resultSets'] end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
4 5 6 |
# File 'lib/nba_rb/team/summary.rb', line 4 def data @data end |
#league_id ⇒ Object
Returns the value of attribute league_id.
4 5 6 |
# File 'lib/nba_rb/team/summary.rb', line 4 def league_id @league_id end |
#season ⇒ Object
Returns the value of attribute season.
4 5 6 |
# File 'lib/nba_rb/team/summary.rb', line 4 def season @season end |
#season_type ⇒ Object
Returns the value of attribute season_type.
4 5 6 |
# File 'lib/nba_rb/team/summary.rb', line 4 def season_type @season_type end |
#team_id ⇒ Object
Returns the value of attribute team_id.
4 5 6 |
# File 'lib/nba_rb/team/summary.rb', line 4 def team_id @team_id end |
Instance Method Details
#info ⇒ Object
25 26 27 |
# File 'lib/nba_rb/team/summary.rb', line 25 def info create_stats_hash(@data[0]) end |
#season_ranks ⇒ Object
29 30 31 |
# File 'lib/nba_rb/team/summary.rb', line 29 def season_ranks create_stats_hash(@data[1]) end |