Class: Sorare::Rewards::Allocations::ComputeForGameWeek
- Inherits:
-
Object
- Object
- Sorare::Rewards::Allocations::ComputeForGameWeek
- Includes:
- Interactor
- Defined in:
- lib/sorare/rewards/interactors/allocations/compute_for_game_week.rb
Overview
ComputeForGameWeek computes the reward allocations for a game week given a supply and seed
Instance Method Summary collapse
Instance Method Details
#allocations ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/sorare/rewards/interactors/allocations/compute_for_game_week.rb', line 21 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 ⇒ Object
16 17 18 19 |
# File 'lib/sorare/rewards/interactors/allocations/compute_for_game_week.rb', line 16 def call context.randomizer = Sorare::Rewards::Random.new(public_seed, salt) context.game_week_allocations = allocations end |
#config ⇒ Object
29 30 31 |
# File 'lib/sorare/rewards/interactors/allocations/compute_for_game_week.rb', line 29 def config Sorare::Rewards.configuration.allocation_configuration end |