class Sorare::Rewards::Allocations::ComputeForGameWeek
ComputeForGameWeek
computes the reward allocations for a game week given a supply and seed
Public Instance Methods
allocations()
click to toggle source
# File lib/sorare/rewards/interactors/allocations/compute_for_game_week.rb, line 20 def allocations supply.keys.index_with do |league| Allocations::ComputeForLeague.call!( **context.to_h, supply: supply[league], config: config[league] ).league_allocations end end
call()
click to toggle source
# File lib/sorare/rewards/interactors/allocations/compute_for_game_week.rb, line 15 def call context.randomizer = Sorare::Rewards::Random.new(public_seed, salt) context.game_week_allocations = allocations end
config()
click to toggle source
# File lib/sorare/rewards/interactors/allocations/compute_for_game_week.rb, line 28 def config Sorare::Rewards.configuration.allocation_configuration end