Class: SportsDataApi::Nfl::TeamSeasonStats

Inherits:
Object
  • Object
show all
Defined in:
lib/sports_data_api/nfl/team_season_stats.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ TeamSeasonStats

Returns a new instance of TeamSeasonStats.



5
6
7
8
9
10
11
# File 'lib/sports_data_api/nfl/team_season_stats.rb', line 5

def initialize(json)
  @id = json['id']
  @stats = []
  json['statistics'].each_pair do | key, val |
    @stats << { key: val }
  end
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/sports_data_api/nfl/team_season_stats.rb', line 4

def id
  @id
end

#statsObject (readonly)

Returns the value of attribute stats.



4
5
6
# File 'lib/sports_data_api/nfl/team_season_stats.rb', line 4

def stats
  @stats
end