Sha256: 4a0266d839e119d1018b2ad2f2bd58b1877e40620820b501774a88dc20590743

Contents?: true

Size: 535 Bytes

Versions: 12

Compression:

Stored size: 535 Bytes

Contents

# frozen_string_literal: true

require "ahl_scraper/fetchers/player_games/data_fetcher"

module AhlScraper
  module PlayerGames
    @season_games = {}

    class << self
      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
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ahl_scraper-0.4.0 lib/ahl_scraper/player_games.rb
ahl_scraper-0.3.8 lib/ahl_scraper/player_games.rb
ahl_scraper-0.3.7 lib/ahl_scraper/player_games.rb
ahl_scraper-0.3.6 lib/ahl_scraper/player_games.rb
ahl_scraper-0.3.5 lib/ahl_scraper/player_games.rb
ahl_scraper-0.3.4 lib/ahl_scraper/player_games.rb
ahl_scraper-0.3.3 lib/ahl_scraper/player_games.rb
ahl_scraper-0.3.2 lib/ahl_scraper/player_games.rb
ahl_scraper-0.3.1 lib/ahl_scraper/player_games.rb
ahl_scraper-0.3.0 lib/ahl_scraper/player_games.rb
ahl_scraper-0.2.0 lib/ahl_scraper/player_games.rb
ahl_scraper-0.1.1 lib/ahl_scraper/player_games.rb