Class: NbaRb::Team::CommonRoster
- Defined in:
- lib/nba_rb/team/common_roster.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#season ⇒ Object
Returns the value of attribute season.
-
#team_id ⇒ Object
Returns the value of attribute team_id.
Instance Method Summary collapse
- #coaches ⇒ Object
-
#initialize(*args) ⇒ CommonRoster
constructor
A new instance of CommonRoster.
- #roster ⇒ Object
Methods included from StatsRequest
Methods included from StatsHash
Constructor Details
#initialize(*args) ⇒ CommonRoster
Returns a new instance of CommonRoster.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/nba_rb/team/common_roster.rb', line 8 def initialize(*args) super(*args) @season ||= NbaRb::CURRENT_SEASON res = stats_request('commonteamroster', 'TeamID' => team_id, 'Season' => season) @data = res['resultSets'] end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
4 5 6 |
# File 'lib/nba_rb/team/common_roster.rb', line 4 def data @data end |
#season ⇒ Object
Returns the value of attribute season.
4 5 6 |
# File 'lib/nba_rb/team/common_roster.rb', line 4 def season @season end |
#team_id ⇒ Object
Returns the value of attribute team_id.
4 5 6 |
# File 'lib/nba_rb/team/common_roster.rb', line 4 def team_id @team_id end |
Instance Method Details
#coaches ⇒ Object
23 24 25 |
# File 'lib/nba_rb/team/common_roster.rb', line 23 def coaches create_stats_hash(@data[1]) end |
#roster ⇒ Object
19 20 21 |
# File 'lib/nba_rb/team/common_roster.rb', line 19 def roster create_stats_hash(@data[0]) end |