lib/sportradar/api/nfl/game.rb in sportradar-api-0.1.33 vs lib/sportradar/api/nfl/game.rb in sportradar-api-0.1.34
- old
+ new
@@ -36,12 +36,12 @@
@venue = Sportradar::Api::Nfl::Venue.new data["venue"] || location["venue"] if data["venue"] || location["venue"]
@home = Sportradar::Api::Nfl::Team.new data["home"] || location["home"] if data["home"] || location["home"]
@away = Sportradar::Api::Nfl::Team.new data["away"] || location["away"] if data["away"] || location["away"]
@broadcast = Sportradar::Api::Nfl::Broadcast.new data["broadcast"] if data["broadcast"]
if data["team"]
- both_stats = data["team"].map { |hash| [hash["id"], Sportradar::Api::Nfl::GameStatistic.new(hash)] }.to_h
- @home.stats = both_stats[@home.id]
- @away.stats = both_stats[@away.id]
+ @stats = data["team"].map { |hash| [hash["id"], Sportradar::Api::Nfl::GameStatistic.new(hash)] }.to_h
+ @home.stats = @stats[@home.id]
+ @away.stats = @stats[@away.id]
end
end
def current_score
"#{summary.home.points}-#{summary.away.points}" if summary