Class: NbaRb::Team::GameLogs

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ GameLogs

Returns a new instance of GameLogs.



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/nba_rb/team/game_logs.rb', line 9

def initialize(*args)
  super(*args)

  @season ||= NbaRb::CURRENT_SEASON
  @season_type ||= NbaRb::SeasonType.default

  res = stats_request('teamgamelog', 'TeamID' => team_id,
                                     'Season' => season,
                                     'SeasonType' => season_type)

  @data = res['resultSets']
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



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

def data
  @data
end

#seasonObject

Returns the value of attribute season.



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

def season
  @season
end

#season_typeObject

Returns the value of attribute season_type.



4
5
6
# File 'lib/nba_rb/team/game_logs.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/game_logs.rb', line 4

def team_id
  @team_id
end

Instance Method Details

#infoObject



22
23
24
# File 'lib/nba_rb/team/game_logs.rb', line 22

def info
  create_stats_hash(@data[1])
end