Sha256: d4b7c91ed91be0672f24f31db1a29f03face77bf6b48bd9432fef152ef1ddc62

Contents?: true

Size: 463 Bytes

Versions: 12

Compression:

Stored size: 463 Bytes

Contents

# frozen_string_literal: true

module AhlScraper
  module Seasons
    class TeamsService
      def initialize(division_data)
        @division_data = division_data
      end

      def call
        @division_data.map do |division|
          division_name = division.dig(:headers, :name, :properties, :title)
          Array.new(division[:data]).map do |team|
            Team.new(team, division_name)
          end
        end.flatten
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

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