module AhlScraper::Seasons
Public Class Methods
list()
click to toggle source
# File lib/ahl_scraper/seasons.rb, line 12 def list @season_data ||= SeasonDataFetcher.new.call&.map { |season_data| SeasonListItem.new(season_data) } @season_data end
retrieve(season_id)
click to toggle source
# File lib/ahl_scraper/seasons.rb, line 17 def retrieve(season_id) @season_data ||= SeasonDataFetcher.new.call&.map { |season_data| SeasonListItem.new(season_data) } season = @season_data.find { |s| season_id.to_i == s.id } Season.new(season) end
retrieve_all()
click to toggle source
# File lib/ahl_scraper/seasons.rb, line 23 def retrieve_all @season_data ||= SeasonDataFetcher.new.call @season_data.map do |season| Season.new(season) end end