class Sorare::Rewards::GameWeekConfig
GameWeekConfig
stores the config used to reward a game week
Attributes
config[R]
Public Class Methods
new(config)
click to toggle source
# File lib/sorare/rewards/game_week_config.rb, line 11 def initialize(config) @config = config end
Public Instance Methods
cooldown_limit(rarity)
click to toggle source
# File lib/sorare/rewards/game_week_config.rb, line 29 def cooldown_limit(rarity) cooldown.dig(rarity, 'quantity') end
cooldown_since(rarity)
click to toggle source
# File lib/sorare/rewards/game_week_config.rb, line 33 def cooldown_since(rarity) cooldown.dig(rarity, 'since') end
distribution_limit(rarity)
click to toggle source
# File lib/sorare/rewards/game_week_config.rb, line 25 def distribution_limit(rarity) limits[rarity] || 1 end
over_limit?(rarity, rewarded)
click to toggle source
# File lib/sorare/rewards/game_week_config.rb, line 21 def over_limit?(rarity, rewarded) limits[rarity] <= rewarded end