Class: AhlScraper::Games::TeamOnIceGoalsService
- Inherits:
-
Object
- Object
- AhlScraper::Games::TeamOnIceGoalsService
- Defined in:
- lib/ahl_scraper/services/games/team_on_ice_goals_service.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(team_id, goal_data) ⇒ TeamOnIceGoalsService
constructor
A new instance of TeamOnIceGoalsService.
Constructor Details
#initialize(team_id, goal_data) ⇒ TeamOnIceGoalsService
Returns a new instance of TeamOnIceGoalsService.
6 7 8 9 |
# File 'lib/ahl_scraper/services/games/team_on_ice_goals_service.rb', line 6 def initialize(team_id, goal_data) @team_id = team_id @goal_data = goal_data end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/ahl_scraper/services/games/team_on_ice_goals_service.rb', line 11 def call @on_ice_statline = generate_on_ice_statline @goal_data.each do |goal| @team_id == goal[:team][:id] ? goal_for(goal) : goal_against(goal) end @on_ice_statline end |