Class: SportsDataApi::Nfl::TeamSeasonStats
- Inherits:
-
Object
- Object
- SportsDataApi::Nfl::TeamSeasonStats
- Defined in:
- lib/sports_data_api/nfl/team_season_stats.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#stats ⇒ Object
readonly
Returns the value of attribute stats.
Instance Method Summary collapse
-
#initialize(json) ⇒ TeamSeasonStats
constructor
A new instance of TeamSeasonStats.
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
#id ⇒ Object (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 |
#stats ⇒ Object (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 |