lib/sportradar/api/nfl/game.rb in sportradar-api-0.1.26 vs lib/sportradar/api/nfl/game.rb in sportradar-api-0.1.27
- old
+ new
@@ -24,12 +24,13 @@
@situation = Sportradar::Api::Nfl::Situation.new data["situation"] if data["situation"]
@last_event = Sportradar::Api::Nfl::Event.new data["last_event"]["event"] if data["last_event"] && data["last_event"]["event"]
@scoring = Sportradar::Api::Nfl::Scoring.new data["scoring"] if data["scoring"]
set_scoring_drives
- @venue = Sportradar::Api::Nfl::Venue.new data["venue"] if data["venue"]
- @home = Sportradar::Api::Nfl::Team.new data["home"] if data["home"]
- @away = Sportradar::Api::Nfl::Team.new data["away"] if data["away"]
+ location = data["summary"] || data
+ @venue = Sportradar::Api::Nfl::Venue.new location["venue"] if location["venue"]
+ @home = Sportradar::Api::Nfl::Team.new location["home"] if location["home"]
+ @away = Sportradar::Api::Nfl::Team.new location["away"] if location["away"]
@broadcast = Sportradar::Api::Nfl::Broadcast.new data["broadcast"] if data["broadcast"]
end
def current_score
"#{summary.home.points}-#{summary.away.points}" if summary