Class: Sorare::Rewards::GameWeekAllocations
- Inherits:
-
Object
- Object
- Sorare::Rewards::GameWeekAllocations
- Defined in:
- lib/sorare/rewards/game_week_allocations.rb
Overview
GameWeekAllocations stores the expected allocations for a game week
Instance Attribute Summary collapse
-
#allocations ⇒ Object
readonly
Returns the value of attribute allocations.
Instance Method Summary collapse
- #each_league_allocations ⇒ Object
- #each_league_rarity_allocations ⇒ Object
-
#initialize(allocations) ⇒ GameWeekAllocations
constructor
A new instance of GameWeekAllocations.
Constructor Details
#initialize(allocations) ⇒ GameWeekAllocations
Returns a new instance of GameWeekAllocations.
9 10 11 |
# File 'lib/sorare/rewards/game_week_allocations.rb', line 9 def initialize(allocations) @allocations = allocations end |
Instance Attribute Details
#allocations ⇒ Object (readonly)
Returns the value of attribute allocations.
7 8 9 |
# File 'lib/sorare/rewards/game_week_allocations.rb', line 7 def allocations @allocations end |
Instance Method Details
#each_league_allocations ⇒ Object
13 14 15 16 17 18 19 |
# 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 ⇒ Object
21 22 23 24 25 26 27 28 29 |
# 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 |