Class: NbaRb::Team::List

Inherits:
BaseClass show all
Defined in:
lib/nba_rb/team/list.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from StatsRequest

#stats_request

Methods included from StatsHash

#create_stats_hash

Constructor Details

#initialize(*args) ⇒ List

Returns a new instance of List.



7
8
9
10
11
12
13
14
15
# File 'lib/nba_rb/team/list.rb', line 7

def initialize(*args)
  super(*args)

  @league_id ||= NbaRb::League.NBA

  res = stats_request('commonteamyears', 'LeagueID' => league_id)

  @data = res['resultSets']
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



4
5
6
# File 'lib/nba_rb/team/list.rb', line 4

def data
  @data
end

#league_idObject

Returns the value of attribute league_id.



4
5
6
# File 'lib/nba_rb/team/list.rb', line 4

def league_id
  @league_id
end

Instance Method Details

#infoObject



17
18
19
# File 'lib/nba_rb/team/list.rb', line 17

def info
  create_stats_hash(@data[0])
end