Class: AhlScraper::Games::PenaltyShotsService

Inherits:
Object
  • Object
show all
Defined in:
lib/ahl_scraper/services/games/penalty_shots_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(penalty_shot_data) ⇒ PenaltyShotsService

Returns a new instance of PenaltyShotsService.



8
9
10
# File 'lib/ahl_scraper/services/games/penalty_shots_service.rb', line 8

def initialize(penalty_shot_data)
  @penalty_shot_data = penalty_shot_data
end

Instance Attribute Details

#penalty_shot_dataObject (readonly)

Returns the value of attribute penalty_shot_data.



6
7
8
# File 'lib/ahl_scraper/services/games/penalty_shots_service.rb', line 6

def penalty_shot_data
  @penalty_shot_data
end

Instance Method Details

#callObject



12
13
14
# File 'lib/ahl_scraper/services/games/penalty_shots_service.rb', line 12

def call
  ordered_penalty_shots.map.with_index { |ps, i| PenaltyShot.new(ps, { number: i + 1 }) }
end