Class: Sorare::Rewards::PrizePools::ComputeForGameWeek

Inherits:
Object
  • Object
show all
Includes:
Interactor
Defined in:
lib/sorare/rewards/interactors/prize_pools/compute_for_game_week.rb

Overview

ComputeForGameWeek computes the prize pools of a game week

Instance Method Summary collapse

Instance Method Details

#callObject



16
17
18
# File 'lib/sorare/rewards/interactors/prize_pools/compute_for_game_week.rb', line 16

def call
  context.prize_pools = prize_pools!
end

#prize_pools!Object



20
21
22
23
24
# File 'lib/sorare/rewards/interactors/prize_pools/compute_for_game_week.rb', line 20

def prize_pools!
  game_week.each_league.each_with_object(Hash.new({})) do |league, game_week_prize_pools|
    game_week_prize_pools[league.name] = ComputeForLeague.call!(league: league).league_prize_pools
  end
end