lib/sportradar/api/basketball/plays/shot_miss.rb in sportradar-api-0.9.59 vs lib/sportradar/api/basketball/plays/shot_miss.rb in sportradar-api-0.10.0
- old
+ new
@@ -6,12 +6,13 @@
def base_key
"fieldgoal"
end
def parse_statistics(data)
super
- @shot_type = @statistics.dig(base_key, 'shot_type')
- @shot_type_desc = @statistics.dig(base_key, 'shot_type_desc')
- @block = Block.new(data, quarter: @quarter) if @statistics['block']
+ stat = @statistics.detect { |hash| hash['type'] == base_key }
+ @shot_type = stat['shot_type']
+ @shot_type_desc = stat['shot_type_desc']
+ @block = Block.new(data, quarter: @quarter, half: @half) if @statistics.detect { |hash| hash['type'] == 'block' }
end
def made?
false
end
end