Module: AhlScraper::PlayerGames

Defined in:
lib/ahl_scraper/player_games.rb,
lib/ahl_scraper/fetchers/player_games/data_fetcher.rb

Defined Under Namespace

Classes: DataFetcher

Class Method Summary collapse

Class Method Details

.list(player_id, season_id) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/ahl_scraper/player_games.rb', line 10

def list(player_id, season_id)
  @season_games["#{player_id}-#{season_id}"] ||= DataFetcher.new(player_id, season_id).call&.map do |player_data|
    player_data[:position] == "G" ? GoalieGameListItem.new(player_data) : SkaterGameListItem.new(player_data)
  end

  @season_games["#{player_id}-#{season_id}"]
end