lib/sportradar/api/football/play_statistics.rb in sportradar-api-0.11.64 vs lib/sportradar/api/football/play_statistics.rb in sportradar-api-0.11.65
- old
+ new
@@ -163,22 +163,26 @@
attr_accessor :attempt, :att_yards, :missed, :yards, :nullified, :blocked, :team, :player
def initialize(data)
@response = data
@attempt = data['attempt'] || data['att']
@att_yards = data['att_yards']
- @missed = data['missed'] || (data['made'] - 1).abs
@blocked = data['blocked'] || data['blk']
+ @missed = data['missed']
@yards = data['yards'] || data['yds']
@nullified = data['nullified']
@team = OpenStruct.new(data['team']) if data['team']
@player = OpenStruct.new(data['player']) if data['player']
end
def made?
- @missed == 0 && !nullified?
+ !missed? && !nullified?
end
+ def missed?
+ @missed == 1 || @blocked == 1
+ end
+
def nullified?
@nullified.to_s == 'true'
end
end
@@ -388,6 +392,6 @@
end
end
end
end
-end
\ No newline at end of file
+end