Class: NbaRb::Team::Seasons

Inherits:
Object
  • Object
show all
Defined in:
lib/nba_rb/team/seasons.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_modeObject

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_typeObject

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_idObject

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

#infoObject



21
22
23
# File 'lib/nba_rb/team/seasons.rb', line 21

def info
  create_stats_hash(@data[1])
end