Class: AhlScraper::Games::PenaltyShotsService
- Inherits:
-
Object
- Object
- AhlScraper::Games::PenaltyShotsService
- Defined in:
- lib/ahl_scraper/services/games/penalty_shots_service.rb
Instance Attribute Summary collapse
-
#penalty_shot_data ⇒ Object
readonly
Returns the value of attribute penalty_shot_data.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(penalty_shot_data) ⇒ PenaltyShotsService
constructor
A new instance of PenaltyShotsService.
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_data ⇒ Object (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
#call ⇒ Object
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 |