class Sorare::Rewards::GameWeekAllocations

GameWeekAllocations stores the expected allocations for a game week

Attributes

allocations[R]

Public Class Methods

new(allocations) click to toggle source
# File lib/sorare/rewards/game_week_allocations.rb, line 9
def initialize(allocations)
  @allocations = allocations
end

Public Instance Methods

each_league_allocations() { |league_name, allocations| ... } click to toggle source
# File lib/sorare/rewards/game_week_allocations.rb, line 13
def each_league_allocations
  allocations.each_key do |league_name|
    return to_enum(:each_league_allocations) unless block_given?

    yield(league_name, allocations[league_name])
  end
end
each_league_rarity_allocations() { |league_name, rarity, league_allocations| ... } click to toggle source
# File lib/sorare/rewards/game_week_allocations.rb, line 21
def each_league_rarity_allocations
  each_league_allocations do |league_name, league_allocations|
    league_allocations.each_key do |rarity|
      return to_enum(:each_league_rarity_allocations) unless block_given?

      yield(league_name, rarity, league_allocations[rarity])
    end
  end
end