Class: NbaRb::Team::Seasons
- Inherits:
-
Object
- Object
- NbaRb::Team::Seasons
- Defined in:
- lib/nba_rb/team/seasons.rb
Instance Attribute Summary collapse
-
#per_mode ⇒ Object
Returns the value of attribute per_mode.
-
#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) ⇒ Seasons
constructor
A new instance of Seasons.
Constructor Details
#initialize(*args) ⇒ Seasons
Returns a new instance of Seasons.
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/nba_rb/team/seasons.rb', line 8 def initialize(*args) super(*args) @season_type ||= NbaRb::SeasonType.Default @per_mode ||= NbaRb::PerMode.Default res = stats_request('teamyearbyyearstats', 'TeamID' => team_id, 'SeasonType' => season_type, 'PerMode' => per_mode) @data = res['resultSets'] end |
Instance Attribute Details
#per_mode ⇒ Object
Returns the value of attribute per_mode.
4 5 6 |
# File 'lib/nba_rb/team/seasons.rb', line 4 def per_mode @per_mode end |
#season_type ⇒ Object
Returns the value of attribute season_type.
4 5 6 |
# File 'lib/nba_rb/team/seasons.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/seasons.rb', line 4 def team_id @team_id end |
Instance Method Details
#info ⇒ Object
21 22 23 |
# File 'lib/nba_rb/team/seasons.rb', line 21 def info create_stats_hash(@data[1]) end |