lib/sportradar/api/basketball/nba/game.rb in sportradar-api-0.9.37 vs lib/sportradar/api/basketball/nba/game.rb in sportradar-api-0.9.38

- old
+ new

@@ -86,12 +86,12 @@ @away_points = data['away_points'].to_i if data['away_points'] @scheduled = Time.parse(data["scheduled"]) if data["scheduled"] @venue = Venue.new(data['venue']) if data['venue'] @broadcast = Broadcast.new(data['broadcast']) if data['broadcast'] - @home = Team.new(data['home'], api: api, game: self) if data['home'] - @away = Team.new(data['away'], api: api, game: self) if data['away'] + # @home = Team.new(data['home'], api: api, game: self) if data['home'] + # @away = Team.new(data['away'], api: api, game: self) if data['away'] @duration = data['duration'] if data['duration'] @clock = data['clock'] if data['clock'] @attendance = data['attendance'] if data['attendance'] @lead_changes = data['lead_changes'] if data['lead_changes'] @@ -103,9 +103,15 @@ update_score(@away_id => @away_points.to_i) if @away_points parse_score(data['scoring']) if data['scoring'] @scoring_raw.update(data, source: source) create_data(@teams_hash, data['team'], klass: Team, api: api, game: self) if data['team'] + end + def home + @teams_hash[@home_id] + end + def away + @teams_hash[@away_id] end def box @box ||= get_box end \ No newline at end of file