lib/ahl_scraper/resources/games/team.rb in ahl_scraper-0.2.0 vs lib/ahl_scraper/resources/games/team.rb in ahl_scraper-0.3.0
- old
+ new
@@ -47,20 +47,20 @@
@shot_stats ||= {
sog: @opts[:shots].map { |period| period[home_team? ? :home : :away] }.reduce(:+),
p1_sog: @opts[:shots].dig(0, home_team? ? :home : :away),
p2_sog: @opts[:shots].dig(1, home_team? ? :home : :away),
p3_sog: @opts[:shots].dig(2, home_team? ? :home : :away),
- ot_sog: @opts[:shots][3..-1]&.map { |ot| ot[home_team? ? :home : :away].to_i },
+ ot_sog: @opts[:shots][3..]&.map { |ot| ot[home_team? ? :home : :away].to_i },
}
end
def goal_stats
@goal_stats ||= {
goals: @opts[:goal_totals].map { |period| period[home_team? ? :home : :away] }.reduce(:+),
p1_goals: @opts[:goal_totals].dig(0, home_team? ? :home : :away),
p2_goals: @opts[:goal_totals].dig(1, home_team? ? :home : :away),
p3_goals: @opts[:goal_totals].dig(2, home_team? ? :home : :away),
- ot_goals: @opts[:goal_totals][3..-1]&.map { |ot| ot[home_team? ? :home : :away].to_i },
+ ot_goals: @opts[:goal_totals][3..]&.map { |ot| ot[home_team? ? :home : :away].to_i },
}
end
def on_ice_stats
@on_ice_stats ||= TeamOnIceGoalsService.new(id, @opts[:goals]).call