lib/sportradar/api/nfl/quarter.rb in sportradar-api-0.1.34 vs lib/sportradar/api/nfl/quarter.rb in sportradar-api-0.1.35
- old
+ new
@@ -10,12 +10,14 @@
@sequence = data["sequence"]
@home_points = data["home_points"]
# @home_points = response['scoring']['home']['points'] # from play_by_play
@away_points = data["away_points"]
# @away_points = response['scoring']['away']['points'] # from play_by_play
- if (raw_drives = data.dig("play_by_play", 'drive'))
+ @drives = if (raw_drives = data.dig("play_by_play", 'drive'))
raw_drives = raw_drives.is_a?(Hash) ? [ raw_drives ] : raw_drives
- @drives = raw_drives.map{ |drive| Sportradar::Api::Nfl::Drive.new drive }
+ raw_drives.map{ |drive| Sportradar::Api::Nfl::Drive.new drive }
+ else
+ []
end
end
end
end